One great feature PrestaShop has is to allow the sale of virtual products. These are downloadable items such as ebooks, videos, audio files, software, etc. These files can be very small or very large in size, depending on the nature of the file.
When adding a virtual product in PrestaShop, there may be issues when the file is over 10MB. The issue manifests as a missing file error like the one below:
This file “testfile.txt” is missing:
Server file name : 9a98f2108138018a56bdeb32f83c8bd285da3358
We have discovered how to correct this issue and explain it in our article below.
How to increase the upload limit in PrestaShop 1.6
- Log into your cPanel dashboard.
- From within the dashboard, click on the File Manager icon, located in the Files category.
- Once in the File Manager navigate to the root folder for your PrestaShop store. Unless you have it in a special folder, the root folder should be public_html.
- Once in the root folder, you should see the normal PrestaShop file structure. You should see an admin folder (though it may be named differently), cache, config, classes, and others. Double click on the classes folder to open it.
- Look through the files and locate the Uploader.php file. Open it for editing.
Once open look for the setting “const DEFAULT_MAX_SIZE = 10485760;” which is located near the top of the file, around line 29. The setting is set in bytes, so 10485760 bytes is 10MB, change it to anything you like. The chart below demonstrates some options in bytes.
MegaBytes |
Bytes |
10 |
10485760 |
20 |
20971520 |
30 |
31457280 |
50 |
52428800 |
100 |
104857600 |
250 |
262144000 |
500 |
524288000 |
1000 (1GB) |
1048576000 |
You do not have to set the numbers exactly as shown, they are merely for reference purposes and for purists like me who have to be exact. Be sure to enter a number large enough to accommodate the file size you will be working with.
- After you edit the setting, click on the Save Changes button in the upper right corner to save and activate the change. You can now upload the file successfully. Below is a before and after showing the error and how it appears once it the setting is changed.
Before |
After |
|
|