ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Avatar upload "The file you are attempting to upload has invalid content for its MIME type"

August 08, 2008 2:33pm

Subscribe [0]
  • #1 / Aug 08, 2008 2:33pm

    Joobs

    362 posts

    It seems users are having problems uploading images to my site.

    First question, is there anyway to automatically resize large images into smaller web images through the upload form?

    Second, there is one avatar that doesn’t seem to upload, I get the mime type error.  It works if i upload it as a super admin, but as a normal user it doesnt.

    The image in question is here:
    removed

    Any ideas what it doesnt like about that image? It was taken on a mobile phone i think.

  • #2 / Aug 08, 2008 2:50pm

    Justin Hurlburt

    344 posts

    Greetings,

    This has come up before I believe. Here is the resolved thread. Let us know if you have any questions.

  • #3 / Aug 08, 2008 2:57pm

    Joobs

    362 posts

    This is a membership site, so users will be uploading avatars (and files through LG file upload extention).  So i don’t like the idea of turning of XSS.

    Also do you know why an image file is throwing up this error?

  • #4 / Aug 08, 2008 3:00pm

    Sue Crocker

    26054 posts

    Joobs, which build/version of EE are you using?

    The most recent build (20080710) had some fixes for XSS.

    Thanks for the link to the image in question. I’ll have the dev team look at it.

  • #5 / Aug 08, 2008 3:35pm

    Joobs

    362 posts

    It seems a new build has come out today!

    It seems “Optimized the upload functionality for XSS checks on images” has sorted my problem. 

    I still need to fully test this to make sure i’m not doing something stupid like logging in as a superadmin etc.

  • #6 / Aug 08, 2008 4:17pm

    Derek Allard

    3168 posts

    Good stuff.  Yeah, please keep us in the loop.  We’ve got a new system going that should greatly reduce false positives, increase speed, and keep the same level of security and protection that you already enjoy.  Do try to beat it up!

  • #7 / Aug 09, 2008 2:11pm

    Joobs

    362 posts

    Good stuff.  Yeah, please keep us in the loop.  We’ve got a new system going that should greatly reduce false positives, increase speed, and keep the same level of security and protection that you already enjoy.  Do try to beat it up!

    Well one issue I have no run into is that it doesn’t like file extensions that are written in caps.  Gives this error:

    The filetype you are attempting to upload is not allowed
    The type of image you are attempting to upload is not an allowed type.

    This is problem because MS Paint saves jpgs and gifs with capitalised file extensions!

    Surely the case of the extension shouldn’t matter?

    Should i just add JPG and GIF to the list of accepted mime types?

  • #8 / Aug 10, 2008 1:09pm

    Robin Sowell

    13255 posts

    For some reason I thought that was already in there.  But won’t hurt to add it if it’s not.

  • #9 / Aug 12, 2008 5:13pm

    Derek Allard

    3168 posts

    Hey joobs.  What browser are you using to upload?  The capitalization of the file extension shouldn’t really be impacting on anything here.

    Is your upload prefs set to images only, or all files?

  • #10 / Aug 12, 2008 7:35pm

    Joobs

    362 posts

    Derek

    I am using the avatar upload in the member control panel, rather than a upload directory.

    I seem to be getting a slightly different error than i reported before (about the caps). Same in both IE7 and Firefox:

    The filetype you are attempting to upload is not allowed
    Images must be one of the following image types: jpg, jpeg, gif, png

    I get this if logged in as a member or superadmin.  A file like “test.jpg” will upload for an avatar, but if i rename the extension as “test.JPG” it gives me the above error.

    I haven’t tested to see if the problem happens with normal file uploading.

  • #11 / Aug 12, 2008 7:46pm

    Mark Bowen

    12637 posts

    Sorry for popping in here but as a quick note I have seen this mentioned before on the forums and I just tried this myself using the Edit Avatar link in my control panel here on these forums and if you have a capitalised extension then that error comes back. I had downloaded the image that was already there first so the image was okay but as soon as you change the extension to be capitals it all goes awry.

    More information here.

    Hope that helps.


    Best wishes,

    Mark

  • #12 / Aug 13, 2008 12:21pm

    Derek Allard

    3168 posts

    Oh, I see.  Sorry, I mistook this for something else.  I’ve amended the behaviour of EE to allow for capital file extensions.

  • #13 / Aug 13, 2008 4:53pm

    Joobs

    362 posts

    Sure no problem.  Sent you an email 😊

  • #14 / Aug 17, 2008 9:34pm

    Robin Sowell

    13255 posts

    Joobs- this one now squared away?  If so, I’ll close it out.

  • #15 / Aug 17, 2008 9:48pm

    Joobs

    362 posts

    Yes

    And the modified file Derek sent me seems to be working 😊

    Thanks for the help

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases