XF 1.5 Browser-specific attachment upload size problem

XWeb Forums

Member
In my newly set-up forum, the 2MB limit appears to be an issue on certain browsers. I've configured for larger uploads to be resized, and it works on fine on IE11/Win7. Fails on Chrome/Win7 and Firefox/Win7. Flash upload is off The failure mode is the indicator strobe in the upper right runs for a while then goes away, leaving the file picker dialog box with the filename now gone. Any ideas?
 
That sounds like a server error. One method for debugging would be to turn JavaScript off entirely in your browser (temporarily) and do the upload. This should more easily expose any server error.
 
Sure enough. On firefox with Javascript off, a 7MB file the error is

Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 5312 bytes) in /home/xwebforu/forum/library/XenForo/Image/Gd.php on line 78

which is $image = imagecreatefromjpeg($fileName);

from php.ini, memory_limit = 32M

Smaller files 5MB/3MB produce no error but nothing happens either.
 
The default PHP memory_limit is 128M, so to get this sorted, you're either going to need to increase the memory limit or reduce the limit for how big of an image XenForo will try to resize.

You can do the latter by adding this to config.php:
Code:
$config['maxImageResizePixelCount'] = 10000000;

In terms of other images where you say you don't get an error, what happens with JS off? It should be taking you back to a page listing the attachments.
 
Thanks Mike. Upping memory_limit to 128M in an .htaccess file appears to have fixed this. Even with that change, with JS off, the upload ends and does not return to attachment list. (Firefox tested)
 
A smaller image (5kb) appears to upload and leaves the user at this screen Capture.webp Same result with a tiny txt file. No path back to the post but maybe that's as expected without JS.
 
Right that's correct, but it does show that the attachment has been uploaded ("new attachments"). That's what I was referring to as the attachment list. So for cases where it doesn't work, what do you end up at?
 
Right that's correct, but it does show that the attachment has been uploaded ("new attachments"). That's what I was referring to as the attachment list. So for cases where it doesn't work, what do you end up at?
Haven't been able to duplicate the problem since the memory change. Looks like all is good now.
 
Top Bottom