djspud Posted August 24, 2011 Share Posted August 24, 2011 I've enabled Product Customization in my shop where a customer uploads an image to customize the product. As it operates now, any image over about 1,000KB just brings them back to the product page without performing the upload. I've tried changing the "Maximum size of product pictures:" in "Back Office > Preferences > Products" to a very large size to no effect. Don't know where to affect it. Database? Code? And while on the subject, the uploader seems to downsample the image's bit depth automatically. Any way to have the uploader not alter the image at all when it saves it to server? I'm using Prestashop 1.4.2.5 Any help is appreciated. Dan Link to comment Share on other sites More sharing options...
jeevanoss Posted August 24, 2011 Share Posted August 24, 2011 Hi, Try to set ini_set('upload_max_filesize', '100M'); in config/config.inc.php Thanks, Jeevan Link to comment Share on other sites More sharing options...
djspud Posted August 25, 2011 Author Share Posted August 25, 2011 Hi, Try to set ini_set('upload_max_filesize', '100M'); in config/config.inc.php Thanks, Jeevan Jeevan, Thanks for the help, but it doesn't seem to affect anything. Here's a log that I created of changing that value in config.inc.php and the result from Prestashop: ------------------------------------------------------------------------------------------------ Image is too large (1106.005KB). Maximum allowed: 10KB */ini_set('upload_max_filesize', '1M'); Image is too large (1912.657KB). Maximum allowed: 10KB */ini_set('upload_max_filesize', '1M'); Image is too large (701.968KB). Maximum allowed: 10KB */ini_set('upload_max_filesize', '1M'); 2049K and larger just brings me back. */ini_set('upload_max_filesize', '1M'); Image is too large (1018.727KB). Maximum allowed: 10KB */ini_set('upload_max_filesize', '10M'); Image is too large (51.162KB). Maximum allowed: 10KB */ini_set('upload_max_filesize', '10M'); 2049K and larger just brings me back. */ini_set('upload_max_filesize', '10M'); Image is too large (1106.005KB). Maximum allowed: 10KB */ini_set('upload_max_filesize', '100M'); Image is too large (80.787KB). Maximum allowed: 10KB */ini_set('upload_max_filesize', '100M'); 2049K and larger just brings me back. */ini_set('upload_max_filesize', '100M'); Image is too large (953.183KB). Maximum allowed: 10KB */ini_set('upload_max_filesize', '1000M'); 2049K and larger just brings me back. */ini_set('upload_max_filesize', '1000M'); Image is too large (1018.727KB). Maximum allowed: 10KB */ini_set('upload_max_filesize', '10000M'); 2049K and larger just brings me back. */ini_set('upload_max_filesize', '10000M'); ... Image is too large (765.152KB). Maximum allowed: 10KB */ini_set('upload_max_filesize', '1000000000M'); 2049K and larger just brings me back. */ini_set('upload_max_filesize', '1000000000M'); --------------------------------------------------------------------------------------------------------- It wasn't until I changed the "Maximum Size of Product Pictures" variable in the admin panel to 999999999 that it started liking and uplodaing images UP TO that 2MB file size again. I'm concerned about Prestashop not dealing with the images over 2MB. It's like the code doesn't like the large file size and stops running. It simply goes back to the product page with no notifications. This is essential to my shop. I'm concerned that if I can't get it to accept any graphic and not alter it, I may need to start over with a different solution. Any help from anyone is appreciated. Dan Link to comment Share on other sites More sharing options...
djspud Posted August 29, 2011 Author Share Posted August 29, 2011 Asking for anyone's input that's used the Product Customization feature. Many thanks, Dan Link to comment Share on other sites More sharing options...
tomerg3 Posted August 29, 2011 Share Posted August 29, 2011 Did you try Preferences->Products Maximum size of product pictures: * The maximum size of pictures uploadable by customers (in Bytes) Link to comment Share on other sites More sharing options...
djspud Posted August 29, 2011 Author Share Posted August 29, 2011 Did you try Preferences->Products Maximum size of product pictures: * The maximum size of pictures uploadable by customers (in Bytes) Yep, that's the first thing I tried. Doesn't seem to affect it. Link to comment Share on other sites More sharing options...
tomerg3 Posted August 30, 2011 Share Posted August 30, 2011 What is the value you see with phpinfo for upload_max_filesize? Link to comment Share on other sites More sharing options...
djspud Posted August 30, 2011 Author Share Posted August 30, 2011 I don't have a file called phpinfo. Should I? I've been changing that variable in config/config.inc.php. Dan Link to comment Share on other sites More sharing options...
tomerg3 Posted August 30, 2011 Share Posted August 30, 2011 phpinfo() is a function that shows your server's PHP settings. Create a new file (anyname.php) and in it add <?php phpinfo(); ?> access it from the browser and look for the variable / value Link to comment Share on other sites More sharing options...
djspud Posted August 30, 2011 Author Share Posted August 30, 2011 It's set to 64M. Is that MB's? Is there something I need to change on the PHP server settings? I really appreciate your help. Link to comment Share on other sites More sharing options...
tomerg3 Posted August 30, 2011 Share Posted August 30, 2011 Can you paste a link to it here? Link to comment Share on other sites More sharing options...
djspud Posted August 30, 2011 Author Share Posted August 30, 2011 Did you receive my PM with link? Link to comment Share on other sites More sharing options...
tomerg3 Posted August 30, 2011 Share Posted August 30, 2011 I got it, it looks correct. I'm not sure what else is could be, you can try to report it in the bug tracker, and get help for a team member. The other option is to add debug code and try to figure out where the lower limit is being set. You can look at any reference to the function checkImage(), as the limit is passed to it. You can also edit /images.inc.php and comment out the size restriction //if ($file['size'] > $maxFileSize) // return Tools::displayError('Image is too large').' ('.($file['size'] / 1000).Tools::displayError('KB').'). '.Tools::displayError('Maximum allowed:').' '.($maxFileSize / 1000).Tools::displayError('KB'); Link to comment Share on other sites More sharing options...
djspud Posted August 30, 2011 Author Share Posted August 30, 2011 That's great, I'll try those. Thanks, I'll let you know. Dan Link to comment Share on other sites More sharing options...
djspud Posted August 31, 2011 Author Share Posted August 31, 2011 Well, I'm a little closer to pinpointing the issue: It seems the filesize isn't the issue. It's the number of pixels. If the total number of pixels (width*height) > 5,893,475 then it stops loading the page after upload. Although I got it to fail with one exception to that rule: it worked with an image 30,000px x 166px (=4,980,000) but didn't with an image 166px x 30,000px. I'm going to keep trying things with images.inc.php, but if someone knows something to try specifically, please let me know. Thanks, Dan Link to comment Share on other sites More sharing options...
kenlee87 Posted September 3, 2011 Share Posted September 3, 2011 guys... can i know what module or anyway to allow customers upload photos in the website? need that function badly Link to comment Share on other sites More sharing options...
tomerg3 Posted September 3, 2011 Share Posted September 3, 2011 You don't need a module, use the "Customization" it's in the product editor from the backoffice http://screencast.com/t/Xu5eHJfUD Link to comment Share on other sites More sharing options...
oceanview Posted October 31, 2011 Share Posted October 31, 2011 Hi djspud, I have the same problem as you do. I've been trying to fix this problem with no luck. Wondering if you have fixed the pixel problem yet? Link to comment Share on other sites More sharing options...
oceanview Posted November 12, 2011 Share Posted November 12, 2011 My file upload problem is solved by changing the hosting server. Link to comment Share on other sites More sharing options...
trco Posted December 11, 2014 Share Posted December 11, 2014 i have same problem, i tryed max uploaded size, htaccess etc. but nothing i found line where is PROBLEM !!!! "........ admin/ajaxfilemanager/inc/config.base.php" 73.line //UPLOAD OPTIONS CONFIG 74.line define('CONFIG_UPLOAD_MAXSIZE', 5000 * 1024 ); //by bytes this line get me max uploaded file size was around 4,9 MB what problem when i tryed upload video 42,5 MB ... i changed 5000 to 50000 and HEUREEEEKAA !!!!! all its ok .. i hope help you ! Link to comment Share on other sites More sharing options...
El Patron Posted December 12, 2014 Share Posted December 12, 2014 i have same problem, i tryed max uploaded size, htaccess etc. but nothing i found line where is PROBLEM !!!! "........ admin/ajaxfilemanager/inc/config.base.php" 73.line //UPLOAD OPTIONS CONFIG 74.line define('CONFIG_UPLOAD_MAXSIZE', 5000 * 1024 ); //by bytes this line get me max uploaded file size was around 4,9 MB what problem when i tryed upload video 42,5 MB ... i changed 5000 to 50000 and HEUREEEEKAA !!!!! all its ok .. i hope help you ! please see back office configuration http://screencast.com/t/6PeqaLRiQr8 Link to comment Share on other sites More sharing options...
Aparsons Posted April 29, 2015 Share Posted April 29, 2015 El Patron, you're a lifesaver - I was just about to comment out the lines in ImageManager.php. Don't ask me how long it took to find them! This is a problem that has affected a lot of people. Link to comment Share on other sites More sharing options...
Aparsons Posted April 29, 2015 Share Posted April 29, 2015 However now when I try to upload a 20M file it all falls over as I exceed my 128M server memory limit. This happens at line 429 in ImageManager.php return imagecreatefromjpeg($filename); I does seem odd that a 20M upload will use the memory limit - but I don't know too much about the internals. Will increasing my memory limit on the server solve the problem or has something gone berzerk? Thanks, Andrew Link to comment Share on other sites More sharing options...
mexicoMATT Posted August 19, 2015 Share Posted August 19, 2015 Hi All, this forum topic seems the closest thing to an issue I'm having with images uploaded within Product Customization shrinking in size once uploaded. But I have checked all the settings & preferences within the back office, and checked the php ini.file settings (thanks to El Patron's free module) but no joy! I'm having some difficulty in finding the answer to this problem. I need customers to upload image files for their personalised items, and this function seems to work well in front office, with images uploading & the preview bring shown. They show at checkout and the customer can complete their order. The images also show up in the preview section of the order in the back office, but when clicked on to download the files have been shrunk from 1 or 2mb to just 4 or 5kb..?? If I look in the "upload" folder via FTP there shows 2 files for each image uploaded, with one having the prefix of "small" added, but both files are the same size at 4 or 5kb. One image I guess is supposed to be "small" for the preview, but why is the other not the full size uploaded image? Any help much apppreciated. I have looked through the forum and can't find anyone who has had a similar problem. I'm using the default bootstrap theme in 1.6.0.14. Hoping it is a minor tweak to some code somewhere, or a module that needs re-setting... Thanks in advance to any forthcoming help. Cheers, Matt. Link to comment Share on other sites More sharing options...
mexicoMATT Posted August 20, 2015 Share Posted August 20, 2015 Quick update on my post above : I think I've worked out what has happened, I made an edit to the code somewhere(?) to change the size of the image preview when an image is uploaded within product customization. I remember changing the size and now think I changed it twice by accident, which is why both the image preview & the uploaded image are the same size. Could someone please tell me which folder/file alters the Image Preview size? It would be much appreciated as I've looked everywhere and can't find the code. Thanks, Matt. Link to comment Share on other sites More sharing options...
mexicoMATT Posted August 31, 2015 Share Posted August 31, 2015 In the end I have upgraded Prestashop to the latest version 1.6.1.1 and the problem has now dissapeared, GREAT... but now have new issue... I hope someone can help? I'm using the default theme. Customers can't upload images greater than 1.6mb through the Product Customization field? I have 3 fields for uploading images, and if you upload 3 images all at once at 1.5mb they will upload and show as previews (also on server in "upload" directory). Thanks to El Patrons ini.file module (FREE) I've checked server specs and all seems well above 20mb upload. The preferences within Back Office are also above 10mb (Preferences>Images & Admin>Preferences) so don't know what else it can be. I have error reporting on, and nothing shows as a debug error. An error does come up within the web page (part of the theme) : There is 1 error An error occurred during the image upload process. If I upload an image as attachment through the "Contact Us" page then the size is slightly bigger at 1.9mb, but anything bigger doesn't appear with the message in the Back Office, and no error message shows. Please if anyone has any suggestions to fix this it would be much appreciated. Thanks, Matt. Link to comment Share on other sites More sharing options...
grsinternet Posted April 8, 2021 Share Posted April 8, 2021 In Prestashop 1.7 there are additional limits in PS back-office: Advanced Parameters -> Administration -> Upload Quota Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now