Jump to content

Error uploading attachments


Recommended Posts

I'm in the midst of uploading a bunch of attachments, mostly PDFs. Now I'm trying to upload another and get this error:

 

 

close.png The File Enphase_Engage_Coupler_application_notes.pdf exceeds the size allowed by the server. The limit is set to 0 MB.

 

The limit is NOT set to 0 MB, it's set to 8 MB. Moreover, the file is only 2.5 MB.

 

Any ideas anyone?

Link to comment
Share on other sites

Prestashop sets the default to 8mb in the backend Administration > Preferences screen, but this fails to take into account your servers upload and max file limits.

 

Diagnose

 

Go to the Administration > Preferences page and you'll see the 8mb limit.

Hit Save on this page and you might receive an error which says the chosen upload limit is higher than the servers allowed upload limit. If this happens, you can fix the issue by the following:

 

The Fix

 

Somewhere in your configuration you need to change the following two variables:

  • upload_max_filesize
  • post_max_size

I chose to do this on a per-site basis, and also raise the memory limit to ensure I don't encounter server issues during debugging. To do this, I edited my .htaccess file in the root of the store, and added the following lines at the top:

 

 

php_value upload_max_filesize 32M

php_value post_max_size 32M

php_value memory_limit 128M

 

Once this is applied, you should be able to Save on the Preferences page and not get the error. You'll want to update your settings on that page to ones similar (but less than) those you specified in the post_max_size and upload_max_filesize directives.

 

These values can also be overridden by your hosting; there's a chance they'll limit it to something like 2 or 4mb by default and you can't override that in your .htaccess. You'd need to speak to your hosting company in that instance.

  • Like 3
Link to comment
Share on other sites

  • 3 years later...

Here is my solution, after spending 15-16 hours:

1. edit prestashop settings: administration>preferences , increase values at "upload quota" block
2. update php.ini file:
    2.1 how to find the location of php.ini file: https://www.ostraining.com/blog/coding/phpini-file/
    2.2 update these values in php.ini  (max_input_time 3200 | post_max_size 32M | upload_max_filesize 32M | max_execution_time 300) https://cloud.digitalocean.com/support/suggestions?article=how-to-change-your-php-settings-on-ubuntu-14-04&page=0&query=upload_max_filesize
3. restart php and nginx services: (in linux with these commands: "service nginx restart" "service php5-fpm restart")
4. increase client_max_body_size of nginx. ( http://stackoverflow.com/questions/2056124/nginx-client-max-body-size-has-no-effect )


4th item of the list is not written in anywhere in prestashop forums and many people who cant find a solution especially VPS users need that. 

I hope it works for you too. 


Cheers,
​Ali

Edited by alikasapoglu (see edit history)
Link to comment
Share on other sites

×
×
  • Create New...