File getting corrupted when ftping it to website

Status
Not open for further replies.

pballz

New Member
Messages
24
Reaction score
0
Points
1
I have a game script that has a db and I upload that every so often for a php page to display stats. But I just checked it today and the page has php errors all over and I traced the problem to the file being corrupt.

Using filezilla to upload the db file manually works fine, but using the windows ftp.exe which I run via a script to upload the file automatically doesn't work. Did anything change with the server? Nothing should of changed on my end and it's weird that the windows ftp program suddenly starts failing to upload the file correctly.

edit:
I did the obvious thing and got another command line ftp program which works but my question still stands.
 
Last edited:

Anna

I am just me
Staff member
Messages
11,772
Reaction score
591
Points
113
The only reason I can think of is that ftp.exe was using the wrong mode, files can be uploaded in ASCII or binary mode. ASCII is generally the choice for text based files (.php, .txt, .css etc) while binary is the choice for images and such things.

If windows ftp.exe uses the wrong mode, that can corrupt files. Normally this would be automatically detected, but if you at some point manually it could stick to that and not automatically chose the best option next time you upload something.
 
Status
Not open for further replies.
Top