Lucagiaicheca Posted January 7, 2014 Share Posted January 7, 2014 (edited) Dear friends, I need your help solving this problem I'm into since I have installed Prestashop 1.5.1; When I upload a file as virtual product or as feature docs (it can be a light pdf tech sheet or a huge video i upload via ftp and rename) after a few days, pc (or mac) says that the file is invalid or corrupted when customer download the file and try to unzip it. This doesn't happen in the first few days since I uploaded the file, but after a while each file stop "working"... If I try to download via ftp the file(s) and add .zip then it works: I can access the files in the .zip and extract them. This could mean files are not corrupted but there's something wrong while downloading them through Prestashop. Please, I need your help, and I can pay for it Thank you so much. Luca. Edited January 7, 2014 by Lucagiaicheca (see edit history) Link to comment Share on other sites More sharing options...
bellini13 Posted January 7, 2014 Share Posted January 7, 2014 Hi Luca, if you are using FTP to upload the files, you are probably using the wrong file type (ascii versus binary). When you zip the files and upload the file, your FTP client knows that a zip file is binary, and automatically uploads using binary mode. You can then extract it properly on the server. However if you upload a file without an extension, or an unknown/uncommon extension, then the FTP client is likely using ascii mode and this causes the corruption. 1 Link to comment Share on other sites More sharing options...
Lucagiaicheca Posted January 7, 2014 Author Share Posted January 7, 2014 Thank you for the help mr. Bellini, you're very kind. I keep on in english though we both are Italians so that everybody can understand, I guess you will agree with me. I already put binary system as uploading ftp setting, I saw it on another thread here on this forum. The question is that as I upload them, for a few days everything seems to be right, customer can download and unzip files without problems. After few days everything gets wrong, nothing seems to work. I think that if the files were corrupted people would never be able to download them. Consider that when I download them via ftp, and add .zip to the file, they can be unzipped, but if I do the same thing via prestashop, it doesn't work I'm getting crazy about this PS. Grazie mille per l'aiuto. Visto che conosco il tuo sito, potrei contattarti per cercare insieme una soluzione? Avresti tempo di seguirmi? Ho anche un paio di altre cose da fare che mi stanno facendo impazzire e il mio programmatore di fiducia non risponde Link to comment Share on other sites More sharing options...
bellini13 Posted January 8, 2014 Share Posted January 8, 2014 I will probably need to better understand your process for uploading the files and then attaching them to products. You would typically do this from the back office product edit pages and not have a need for FTP. Can you explain your process step by step so I can understand. Link to comment Share on other sites More sharing options...
Lucagiaicheca Posted January 8, 2014 Author Share Posted January 8, 2014 Considering that I need uploading big files (like 100Mb and more), and back office has a limit in upload I do the following: 1. Create a new virtual product 2. Upload as virtual product a file (i.e. small_file.zip, usually containing .txt file) 3. Go to ftp in the download folder and check for the last file created, which is of course my new product 4. Copy the file name prestashop has given to the file (i.e. MDF845339KRDITENDJRO4) 5. Upload my big_file.zip file via ftp 6. Rename big_file.zip as MDF845339KRDITENDJRO4 This is how I upload big files as virtual products. I must say that in the meanwhile I have (MAYBE) found the solution for my issue downloading the last version of prestashop (1.5.6.0) and replacing the new version of controllers/front/GetFileController.php; I'm testing right now if it works, I really hope so!! Thank you for helping, I will let you know if this solution works for me. Luca Link to comment Share on other sites More sharing options...
bellini13 Posted January 8, 2014 Share Posted January 8, 2014 Ok, let us know what you changed in GetFileController that you believe was causing the corruption. You can atleast rule out if the file itself got corrupt by... 1) downloading MDF845339KRDITENDJRO4 using FTP binary mode to your desktop 2) rename MDF845339KRDITENDJRO4 to small_file.zip 3) attempt to open small_file.zip If you can open the file then you know the file itself is fine, and the problem exists somewhere else. Link to comment Share on other sites More sharing options...
Recommended Posts