Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8495301
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T23:32:11+00:00 2026-06-10T23:32:11+00:00

The following command returns true and uploads the text XML file to the FTP

  • 0

The following command returns true and uploads the text XML file to the FTP server:

if (ftp_put($this->ftpConnectionId, $this->remoteXmlFileName, $this->localXmlFileName, FTP_ASCII)) {

However, when I try to upload a .zip file intead of a text XML file, it still returns true but does not upload the file:

if (ftp_put($this->ftpConnectionId, $this->remoteXmlFileName, $this->localXmlFileName, FTP_BINARY)) {

I found that if I simply rename the zip file to “.xml”, it WILL upload the file but the .zip file is corrupted.

But if I rename the zip file to “.zip.xml” it again returns true but does not upload the file.

What could be the reasons for this odd behavior?

Additional Info:

A zip file can be uploaded via FileZilla no problem with the same account.

I also am specifing:

ftp_pasv($this->ftpConnectionId, true);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T23:32:13+00:00Added an answer on June 10, 2026 at 11:32 pm

    A zipfile is a binary file. That’s probably why uploading it as .xml corrupts the file. Try specifying FTP_BINARY instead of FTP_ASCII. FTP_BINARY will work for ascii files too, but not vice versa, so you can better always use FTP_BINARY than always FTP_ASCII.

    The ftp server may reject the file for many reasons, so it may allow the upload at first, but then not save the file. The ascii/binary problem may be one, but also some file extensions may be blacklisted, or the file could be too big. The latter is unlikely, though, since uploading the zipfile with a different extensions worked for you.

    I think the ftp server actively ignores zip files.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

exec() appears to be enabled on the server (function_exists('exec') returns true, and command is
The following command gives many manuals of Zsh man zsh<tab> alt text http://dl.getdropbox.com/u/175564/zsh.png I
I am using following command for start the production server. nohup ruby script/server webrick
I am running the following command from my home directory: python -m CGIHTTPServer This
I have the following script #!/bin/sh if [cat stream_should_be_running.txt == 'true']; then #file will
How do you return 0 instead of null when running the following command: SELECT
Following command will let me know the names of databases. $ mysqlshow But how
The following command causes an exception. cv::imwrite(test.jpg, diffImg); I also tried numerous variations on
I'm using the following command to set up the AWS launch config: as-create-launch-config test1autoscale
I run the following command to link the different files in my project. /opt/gcc-4.7-cilkplus/bin/gcc

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.