php - FTP corrupts files after certain delay and/or size -
I am creating some Excel files with PHPExcel and I'm storing them on a server running the script. This part works well.
Then I try to send them to the ftp_put on my client's FTP server, but the file gets corrupted on the server.
Opening them after opening them the FTP server with Filezilla, I get an error saying that there is a problem with the contents of the file and if I want, try to repair as much as you want. Are there. It does not help you do this.
If the excel file is less than 100-120k, which has been sent brittle without it, larger than it becomes corrupted.
Send via FTP
$ conn_id = ftp_connect ($ hostFTP); If ($ login_result = ftp_login ($ conn_id, $ userFTP, $ passwordFTP)) {ftp_pasv ($ conn_id, true); If (ftp_put ($ conn_id, $ remote_path $ .output_filename, $ localpath. $ Output_filename, FTP_BINARY)) {$ log = new log ("listes.log", "uploaded $ output_filename"); } And {$ log = new logs ("listes.log", "Failed to upload $ output_filename"); } Ftp_close ($ conn_id); }
Am I doing something wrong? What can i do
Edit:
Comparing files in text shows that some differences starting from line 231, which I think is around 100-120k mark
tried with an image (JPG) and it has also become corrupted (the image is fine above, but at one point it is just corrupt and the rest of the image is too much a single color), hence the problem is Excel Is not accompanied;
Is it possible that the server (open) limits the FTP? And if so how?
Well I got the problem, this code is not its internet service. We changed the internet provider yesterday And FTP works fine now. I think the FTP connection was interrupted from the previous provider.
Comments
Post a Comment