There is currently a problem that may occur when you create a virtual product and upload a file for that product. The problem appears in two ways: 1)As an error message stating that the file is missing, and 2)with no actual error message. The process simply seems to time out. The following article explains how problem occurs and how to fix the issue.
The error occurs when you create a virtual product and then attempt to associate a large file with that product. Depending on the size of the file that you upload and the declared upload limit, you may or may not see the following error:
In some cases, you may not see the error message appear, and the PrestaShop application will appear to be running normally. You can verify the problem by simply waiting a few minutes. When you review the virtual product, the file will not be available for the virtual product.
PrestaShop 1.6 allows you to add virtual products that have associated downloadable files in your catalog of products. These files may vary in size, but by default PrestaShop limits the size of the file to 10 MB. The 10 megabyte limit can be found in the UPLOADER.PHP file of your PrestaShop installation. If your file is larger than 10 MB, then you will need to increase the virtual product upload limit.
We will be using the cPanel File Manager and the editor option to edit the upload limit in the UPLOADER.PHP file. If you are not a customer of Web Hosting Hub or you prefer to use a different program, you can also use an FTP client to download the file, and then a text editor to edit the file. Note that the path may vary depending on where you have installed PrestaShop 1.6, but the default path for the file that you are editing is /public_html/classes/uploader.php.
Locate the line that reads "const DEFAULT_MAX_SIZE = 10485760;". It will be near the top of the file. The screenshot below gives an example of how the entry will appear in the file:
The problem with the virtual product file will be fixed and PrestaShop 1.6 should now be able to save a file that is larger than 10MB. If you continue to have issues with this problem, please leave a question for the Community support team.
n/a Points
|
2015-05-21 2:22 pm
Above Code did not work. Here is the fix:
Location: {PrestashopFolder}/controllers/admin File: AdminProductsController.php Old Code (line # 1340): $post_max_size = Tools::getMaxUploadSize(Configuration::get('PS_LIMIT_UPLOAD_FILE_VALUE') * 1024 * 1024);
New Code: $post_max_size=104857600;
Replace old code with the net code. It will allow you to upload 1000 MB file. You may add or remove Zero (0) from the last to increase or decrease teh limit. |
n/a Points
|
2015-11-04 10:24 pm
I am unable to do this, please provide me a detailed solution. |
Staff 17,314 Points
|
2015-11-05 4:50 pm
Hello AbdulWahab,
You will need to have access to the files of your PrestaShop installation. If you are hosting with Web Hosting Hub, then you could use the file manager to find the file. Standard procedure before you make ANY change to your website is to make a backup. Please backup before you make any changes. The location is given to you above - when you look at the directories, match it with the location controllers/admin, then edit the AdminProductsProducts.php file. You will then look for the following: Old Code (line # 1340): $post_max_size = Tools::getMaxUploadSize(Configuration::get('PS_LIMIT_UPLOAD_FILE_VALUE') * 1024 * 1024); And replace it with the following code. New Code: $post_max_size=104857600; I hope that helps to answer your question! If you require further assistance, please let us know! Regards, Arnel C. |
n/a Points
|
2018-02-19 3:09 am
I replaced the old with this $post_max_size=104857600; and my file still says The file size exceeds the size allowed by the server. The limit is set to 8 MB.. What can I do? |
Staff 12,339 Points
|
2018-02-19 7:32 pm
You may have to make the changes in your php.ini file recursive, so the changes are reflected on the child folders. I recommend creating a phpinfo page to verify the setting has been changed.
Thank you, John-Paul |
n/a Points
|
2016-06-22 11:33 am
Thanks a lot. Second solution worked very well.
MJ
|
n/a Points
|
2017-04-24 1:10 pm
It;s not diffiuclt.If you CANNOT edit php.ini or htacces I've this tips: You must acces Direct Admin Account. Make 3 browser tabs1 First open your product (vritual product) in a browswer tab2 Open you Direct admin in antoher tab of your browser3 Open you preferences in PRestashop backoffice, by the upload size settings.Al those Three tabs must open. Go to your first tab first Ad your uppload virtual product Thisproduct.zip (BUT NOT SAVE)Go to Direct admin, and settings set on php module version: NATIVE and SAVEGo to third tab and change te prestahop backend upload size to 600 (megabytes) SAVE.Go back to the first tab and Click SAVE and STAY... Wait, and now upload is succesfull.Go back to your php settings in direct admin, and set this to current 7.0 version, SAVE your module set.You can set back in orginal settings the prestashop backend upload settiings, but' its not nessescsy.Works in 1.6 en 1.7 PRestashop.-------------------------------Go to http://www.hideurlscript.com for hide your files url path like mp4 video in source code! And in browser address. |
Email: | support@WebHostingHub.com | Ticket: | Submit a Support Ticket |
---|---|---|---|
Call: |
877-595-4HUB (4482) 757-416-6627 (Intl.) |
Chat: | Click To Chat Now |
We value your feedback!
There is a step or detail missing from the instructions.
The information is incorrect or out-of-date.
It does not resolve the question/problem I have.
new! - Enter your name and email address above and we will post your feedback in the comments on this page!