Chris_St Posted March 29, 2017 Share Posted March 29, 2017 Hi, I would like to be able to upload images to a max of 750kb. Searching the forums I found this in a previous post from B Smither: In the file /classes/filemanager.class.php, line 25, set the max file size you want I changed it to 75000 but it just gets an x on the upload and still says its too big max size 350kb I also tried this from another post; private $_directories; private $_mode; private $_manage_cache; private $_manage_dir; private $_manage_root; private $_recently_uploaded = array(); private $_sub_dir; private $_sendfile = false; //private $_max_upload_image_size = 350000; private $_max_upload_image_size = 6291456; // 6MB public $form_fields = false; Still no good. Can anyone tell me please if there any other ways to get larger files into cube cart images section? Regards, Chris Australian United Artists Quote Link to comment Share on other sites More sharing options...
Al Brookbanks Posted March 29, 2017 Share Posted March 29, 2017 Have a look at this line: https://github.com/cubecart/v6/blob/master/admin/skins/default/js/admin.js#L322 Quote Link to comment Share on other sites More sharing options...
Noodleman Posted March 29, 2017 Share Posted March 29, 2017 in the newer versions you also need to adjust the javascript within the admin skin as there is a limit defined there. Previously the limit was only server side, now it does client and server side checks. clear your browser cache or hard refresh (CTRL F5) after making the change. From memory, I think it's in dropzone.js Quote Link to comment Share on other sites More sharing options...
Chris_St Posted March 29, 2017 Author Share Posted March 29, 2017 19 minutes ago, Al Brookbanks said: Have a look at this line: https://github.com/cubecart/v6/blob/master/admin/skins/default/js/admin.js#L322 Hi Al and Noodleman. Changed both files and now works well. Thanks folks. One question, will I need to do this after an update to a new version? (currently am up to date) Thanks Quote Link to comment Share on other sites More sharing options...
Noodleman Posted March 29, 2017 Share Posted March 29, 2017 Yup, after every update unless you create a custom admin skin. but that's not a great idea because you probably want the updates Quote Link to comment Share on other sites More sharing options...
Al Brookbanks Posted March 29, 2017 Share Posted March 29, 2017 Just now, Noodleman said: Yup, after every update unless you create a custom admin skin. but that's not a great idea because you probably want the updates Agreed. It's frustrating we have to impose this limit. I develop on a mac and PHP is configured to be able to ask for extra resources when needed. I can upload a 10Mb file and PHP will create thumbnails. Unfortunately most hosting companies don't allow temporary resource spikes and we are bound to the fixed PHP memory limit. In this case many images over 350Kb will crash the store. Memory errors in GD crashes are impossible to catch. Although this limit is annoying.. I don't think we have much choice. I'd rather impose it then have a new merchant upload 5Mb files direct from their SLR then think CubeCart is crap because the server crashes out. Quote Link to comment Share on other sites More sharing options...
Chris_St Posted March 29, 2017 Author Share Posted March 29, 2017 Thanks Guys, I understand. I have increased it to 750kb. Most images are OK at the 350kb limit but sometimes the clarity seems compromised when I compress vendors images. I will be resizing images from vendors to between 350 and 500kb so that should be OK, Thanks Quote Link to comment Share on other sites More sharing options...
Al Brookbanks Posted March 29, 2017 Share Posted March 29, 2017 Great. Quote Link to comment Share on other sites More sharing options...
Noodleman Posted March 29, 2017 Share Posted March 29, 2017 It would be nice to make this limit easier to change/configure. For customer who have a dedicated server, VPS or decent hosting package then a higher limit is normally not a problem. If this could be a configurable via the store settings it would remove the need for this change as part of an update for quite a lot of stores. If it breaks for somebody, they can easily reduce the setting to something more applicable to their environment and it could default to the current 350Kb limit. DOH, I forgot I already requested it https://github.com/cubecart/v6/issues/712 Quote Link to comment Share on other sites More sharing options...
Al Brookbanks Posted March 29, 2017 Share Posted March 29, 2017 Yes I agree. Maybe a root file called constants.php with a bunch of well.. constants. Quote Link to comment Share on other sites More sharing options...
Noodleman Posted March 29, 2017 Share Posted March 29, 2017 that still requires a file edit though, which most people either don't want to do or are fearful of doing. If it can be read from a PHP file as a constant, then there's no reason it can't be derrived from config? Quote Link to comment Share on other sites More sharing options...
Al Brookbanks Posted March 29, 2017 Share Posted March 29, 2017 yes it could indeedy Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.