Configure the file upload size in PrestaShop

PrestaShop allows you to associate certain types of files with products in the Store, as we have already seen in the article dedicated to it in this Blog.

By default, most Hostings configure the directive post_max_size with values ​​ranging from 20 to 55 Megabyteas is the case of , so that customers do not have low limitations to upload files to their Hosting.

Hosting Mautic QuickStart -50% with support in Spanish
24 hours and free training

Send up to 1,000,000 emails/year. Mautic support in Spanish 24 hours, 365 days

It is important to note that most CMS, in this case PrestaSHop, need to be configured to set the size of the files that can be uploaded to the Hosting. Configuring these parameters is essential to avoid errors when uploading files.

Two values ​​that PrestaShop requires to be configured with values ​​higher than the ones we set in PrestaShop are:

php_value post_max_size php_value upload_max_filesize

For these directives to be effective, the server where the Hosting account is hosted must, since by default many Hosting services disable this functionality for security reasons.

Note: On servers running PHP 5.x instead of php_value should be used php5_value.

If the memory limit is activated by a configuration script, memory_limit it also affects file uploads. by rule memory_limit must be greater than post_max_size.

Some Hosting services allow you to configure these directives from the .htaccess file, adding the following:

upload_max_filesize = “25M” post_max_size = “25M”

These directives have no application in .htaccess files in Hostings.

Of course, if by default the Hosting limits the maximum size allowed to 5M (Megabytes), increasing it to 60M or a higher value, for example, will not apply to the directive, nor will it make sense to apply it. Integers must always be used.

See also  Problems logging into Memberpress

Applying this change to the .htaccess file if your server does not allow it will cause a error 500 when trying to access your PrestaShop Store or view it from the front office.

In PrestaShop you can configure the size of the files that can be uploaded from the back office or from the front office if they are enabled through a specific module.

PrestaShop upload size settings:

  1. Access the back office of PrestaShop.
  2. go to Management, preferences, upload fee.
  3. Configure the fields:
  • Maximum size of attachments
  • Maximum size for a downloadable file
  • Maximum size for a product image
  • Save the changes.
  • Configuring correct values ​​in the file upload quotas will limit the users or administrators of a PrestaSHop store to prevent them from uploading files larger than those allowed, taking into account that the final limitation is established by the variable upload_max_filesize in the File php.ini sel Hosting.

    Help us improve our content by sharing your opinion

    Member of the technical support team.
    Coordinator of contents in the Blog and in Youtube.
    Technical support in CyberProtector. Teacher at University

    Loading Facebook Comments ...
    Loading Disqus Comments ...