calinflorin Posted April 14, 2014 Share Posted April 14, 2014 (edited) Hi ! I recently installed prestashop 1.6.0.6 and when I try to upload a product image I receive de following error: filename.jpg : Server file size is different from local file size PHP: 5.3.18 MySQL: 5.1.55 upload_max_filesize = 32M; theme in use: default-bootstrap Required parameters: Ok Optional parameters: Ok I haven't modified any file from the server. I tried chmod 777 for img folder and doesn't work. Is this a general bug? Is there any fix for this? Edited April 15, 2014 by calinflorin (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted April 15, 2014 Share Posted April 15, 2014 chmod 777 not always works well, for example on aruba host or ovh. make sure that you use suggested by your hoster permissions for directories Link to comment Share on other sites More sharing options...
thektalin Posted April 15, 2014 Share Posted April 15, 2014 (edited) Hi, In file classes/Uploader.php at line 179 you have if ($file_size === $file['size']) I changed to (see below) and worked for me. if ($file_size = $file['size']) Please try . Thank you. Edited April 15, 2014 by thektalin (see edit history) 2 1 Link to comment Share on other sites More sharing options...
calinflorin Posted April 15, 2014 Author Share Posted April 15, 2014 Hi, In file classes/Uploader.php at line 179 you have I changed to (see below) and worked for me. Please try . Thank you. works now Thank you Link to comment Share on other sites More sharing options...
vekia Posted April 15, 2014 Share Posted April 15, 2014 strange that it works because = is not valid comparison operator in php language 1 Link to comment Share on other sites More sharing options...
shapramsey Posted December 18, 2014 Share Posted December 18, 2014 In my way the problem was in missing tmp folder in img folder. So I made it and problem solved. img/tmp (777) Link to comment Share on other sites More sharing options...
vytenizs Posted February 9, 2015 Share Posted February 9, 2015 Hi, In file classes/Uploader.php at line 179 you have I changed to (see below) and worked for me. Please try . Thank you. This is bad. Search for better solution, u just removed important security check. My solution was to create folder cache/sandbox. Other theme may have other solutions. Just look why php cant get filesize of a file. Mostly its because file does not exists, because of non existing folder withing some point of a file path. 1 Link to comment Share on other sites More sharing options...
Recommended Posts