Jump to content

Server file size is different from local file size


Recommended Posts

Hello,

 

I just started a shop this week, today i bought a Theme on template monster.

 

I followed every instruction to install that theme correctly, but when i go on Add Theme, then Add files and select my .zip file.

 

I have this error : Server file size is different from local file size

 

 

What can i do to install my theme....

 

I didn't find any solution till now.

 

Thank you.

Link to comment
Share on other sites

Prestashop is comparing the size of the file on your computer, to the size of the file that you just uploaded to the server.  Technically they should be the exact same size, and if they are not, then likely something is wrong.

 

You can try to bypass this validation, but if the file really is corrupt after uploading, then other things could go wrong, so you do this at your own risk.  I also did not test this.

 

I am assuming you are using PS v1.6.0.11, in the future it is a good idea to state this.

 

Edit the class file /classes/Uploader.php.  around line 159 you will find the function called 'upload', and inside that function you will see these lines of code

if ($file_size === $file['size'])
{
    $file['save_path'] = $file_path;
}
else
{
    $file['size'] = $file_size;
    unlink($file_path);
    $file['error'] = Tools::displayError('Server file size is different from local file size');
}

remove those lines and replace them with the following

if ($file_size === $file['size'])
{
    $file['save_path'] = $file_path;
}
else
{
    $file['save_path'] = $file_path;
}

 

Link to comment
Share on other sites

Hi bellini13 !

 

Thank you so much for your answer, i just modify this php file as you said to me, but now when i add the zip file of my theme on the panel, i have another error :

 

"Zip file seems to be broken"

 

 

I am so disappointed that i can't even install this theme...

Link to comment
Share on other sites

Try to unzip that theme and check its content.

 

Sometimes theme is packed with documentation and PSD files in one big zip file.

 

And that big zip file contain theme zip file that should be used.

This was the issue, i unzipped this source file and now i have a new source folder.

I Tried to upload the theme from my computer now, but i have another issue, it writes :

 

Upload succesful.

 

But when i want to apply my theme, i can't even see him.

 

If someone with a good hearth will take 5min to help me i would appreciate it a lot.

 

Skype : amoniks99

Link to comment
Share on other sites

  • 4 weeks later...
  • 9 months later...
  • 2 months later...
  • 6 months later...

Hey I had the same problem.

I looked into my /cache folder and discovered that some folders and 1 file was missing.

I then copied them from my old site.

And now I can Import themes again.

I don't know if this could help you :)

Link to comment
Share on other sites

  • 2 weeks later...

Same here, so i checked my error.log:

PHP message: PHP Warning:  move_uploaded_file(/var/www/my-domain/cache/sandbox/57d956664fb7a/uploaded.zip): failed to open stream: No such file or directory in /var/www/my-domain/classes/Uploader.php on line 186

 

so, i did create folder sandbox and set perm 0775

now working fine.

Link to comment
Share on other sites

×
×
  • Create New...