Image Uploads Failing at 100%

3 posts by 2 authors in: Forums > CMS Builder
Last Post: November 3, 2011   (RSS)

Re: [dennisoneil] Image Uploads Failing at 100%

By Jason - November 3, 2011

Hi Dennis,

We have seen this problem before. The issue here isn't the size of the file, but the dimensions of the image. Singe the height X width of the image is so large, the php function that re-sizes the image runs out of server memory and causes an error. The actual error is suppressed by CMS Builder due to an unrelated issue, which is why the upload appears to stall.

If you don't have the upload field creating thumbnails, the problem would go away.

The current work around for this is to attempt to increase the server's memory limit for scripts.

NOTE: Make a backup of your database and files prior to attempting any custom changes.

Open up cmsAdmin/lib/init.php you'll see a series of calls to ini_set() at the top of the file. At the end of this list you can add this line:
ini_set('memory_limit', '256M');

This increases the scripts memory limit from 128MB to 256MBs. That should allow you to upload and resize images of those dimensions. The upload may still be slow because of that size, but it should work. Please note that this is a custom fix, so if you upgrade your copy of CMS Builder, you'll need to put this line back in.

Hope this helps
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] Image Uploads Failing at 100%

This worked perfectly. Thank you Jason.