Much has been written about using the FTP protocol in code to upload files to websites. My problem is different, and is as follows:
I am using the following files to upload a batch of PDF files to my website:
ftp -i -s:FTP_cmd_Example.txt mywebsite.com
Using these two files, the PDF files do upload successfully; however, after the uploading, the files become corrupted. I tried this with PDF files and Word files.
In the attached file, I show the before-and-after screenshots of the uploaded PDF file. I also show the error message when trying to open the corrupted Word file (after it had been uploaded).
(1) When I upload the same files using an FTP client (Filezilla), the corruption does not occur.
(2) When I use the code to upload the files to a test bed site, the corruption does not occur