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 8478127
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T18:39:33+00:00 2026-06-10T18:39:33+00:00

Edit: this describes my problem exactly, but I can’t overcome it with PHP: http://kb.winzip.com/kb/entry/149

  • 0

Edit: this describes my problem exactly, but I can’t overcome it with PHP: http://kb.winzip.com/kb/entry/149

I am writing an automated backup script in PHP which makes a backup copy of my website’s files and database, and sends these files to a remote FTP site for disaster recovery. My SQL and ZIP files (no pun intended on the My SQL) are generated perfectly on the server, however, my ZIP archive becomes corrupt when it is uploaded to the FTP site.

I downloaded the ZIP file from the server which generated it, and opened it no problem. But no ZIP extraction program seems to be able to open the same file once it is transferred to the FTP site and downloaded from there. I can open my SQL file no problem.

I’m pretty sure the archive is OK, but rather, the fault lies in the transferring of the file:

$conn_id = ftp_connect("ftp.example.com");
$login_result = ftp_login($conn_id, "johnny1", "Re@l1y $tr0nG P@5swOrd!");
$dbBackup = fopen('database-backup.sql', 'r');
$filesBackup = fopen('files-backup.zip', 'r');

if (ftp_fput($conn_id, 'database/backup.sql', $dbBackup, FTP_BINARY) && 
    ftp_fput($conn_id, 'files/backup.zip', $filesBackup, FTP_BINARY)) {
  echo "Done!<br>";
} else {
   echo "Failed";
   exit;
}

ftp_close($conn_id);
fclose($dbBackup);
fclose($filesBackup);

Is there anything wrong with the transfer of the ZIP file that you can see from here?

Thank you for your time.

  • 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-10T18:39:34+00:00Added an answer on June 10, 2026 at 6:39 pm

    I’ve tested your code on my Ubuntu system and it worked without problems.
    This is probably an FTP server problem; you should try to upload the file on another FTP server.

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

Sidebar

Related Questions

This page describes all steps to edit RC: http://msdn.microsoft.com/en-us/library/dd456813.aspx Those are easy steps, pretty
Edit: This problem was down to me passing the wrong view to the Touch
EDIT: This post was originally specific to ASP.NET, but after thinking about it I'm
[Edit: This problem applies only to 32-bit systems. If your computer, your OS and
EDIT: This problem has been solved. See below. Hey all. I'm building an iPhone
I am having the same problem this person describes . The spinner on the
I was checking out this link: http://blogs.msdn.com/b/stuartleeks/archive/2011/01/25/asp-net-mvc-3-integrating-with-the-jquery-ui-date-picker-and-adding-a-jquery-validate-date-range-validator.aspx which describes creating a jquery datepicker for
I'm trying to follow this tutorial about WP7 development: http://mobile.tutsplus.com/tutorials/windows/introduction-to-windows-mobile-7-development/ It's talking about using
I can't describe the problem well enough in the title. If somone has edit
edit This question is solved! Having something weird. I'm using html { font-size: 100%

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.