Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

JFIF Image uploading

Started by ftforum, December 22, 2010, 01:13:42 PM

Previous topic - Next topic


We have a user who has a .jpg file extension but the file is actually in JFIF format. When he tries to upload, it crashes and comes up with a security error. This is stange as I have disabled attachment security in admin.

Any ideas?


Yeah. Tell the user not to use JFIF encoded images! :)

Easy enough to convert, after all.


Well we have now had a whole host of complaints from people who do not have JFIF images and just standard jpg and stil get the message:

An Error Has Occurred! Your attachment has failed security checks and cannot be uploaded. Please consult the forum administrator.

What's going on?


And with recoding turned on we get...

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 2365 bytes) in /home/ftf/public_html/forum/Sources/Subs-Graphics.php on line 424


This error message usually springs up in a previously functional PHP script when the memory requirements exceed the default 8MB limit. Don't fret, though, because this is an easy problem to overcome.

To change the memory limit for one specific script by including a line such as this at the top of the script:


The 12M sets the limit to 12 megabytes (12582912 bytes). If this doesn't work, keep increasing the memory limit until your script fits or your server squeals for mercy.

You can also make this change permanently for all PHP scripts running on the server by adding a line like this to the server's php.ini file:

memory_limit = 12M


Thanks, problem now resolved.

I set the limit to unlimited on the PHP config but this resulted in the form script crashing (but the image actually uploading ok).

I changed the limit to a specified value until it worked (as suggested) and now it seems to work fine.


I'm having a VERY similar issue, except that my users can't post anything bigger than 86KB. Where could i enter these vairables to circumvent any possible issues?