Advertisement:

Author Topic: Problem with avatars and attachments in IE after installing 2.0.6  (Read 15648 times)

Offline GL700Wing

  • Full Member
  • ***
  • Posts: 485
  • Gender: Female
Re: Problem with avatars and attachments in IE after installing 2.0.6
« Reply #40 on: November 06, 2013, 07:34:38 AM »
I got no idea why they're failing in the first place ;)
My forum users have also experienced the same issues with IE not always displaying images since the upgrade to 2.0.6 and commenting out the following line in index.php fixed the issue in a few posts I checked:
Code: [Select]
header('X-Content-Type-Options: nosniff');
After reading this thread (and 2.0.6 upgrade - simple portal block issue) I did a bit of Googling and found the following: IE9 and IE10 does not display CAPTCHA image sometimes and JIRA will not display images with the wrong MIME type in IE due to nosniff header

Based on the information in the these two posts about the issue relating to the incorrect MIME type I then checked the value of 'mime_type' in the 'smf_attachment's table for the images that would not display with 'nosniff' enabled and discovered that it was empty.  As the images were 'jpg' images I updated the 'mime_type' field with the value 'image/jpeg' (and re-enabled 'nosniff' in index.php) and after refreshing the page the images displayed!

I then ran the following SQL commands against my database (after making a backup first!) for the different image types and IE is now behaving itself!

UPDATE `smf_attachments` SET `mime_type` = 'image/bmp' WHERE `fileext` = 'bmp' AND `mime_type` = '';
UPDATE `smf_attachments` SET `mime_type` = 'image/gif' WHERE `fileext` = 'gif' AND `mime_type` = '';
UPDATE `smf_attachments` SET `mime_type` = 'image/jpeg' WHERE `fileext` = 'jpg' AND `mime_type` = '';
UPDATE `smf_attachments` SET `mime_type` = 'image/png' WHERE `fileext` = 'png' AND `mime_type` = '';
Life doesn't have to be perfect to be wonderful ...

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 72,340
Re: Problem with avatars and attachments in IE after installing 2.0.6
« Reply #41 on: November 06, 2013, 08:08:03 AM »
Ahhhh, that makes sense, though that should primarily only affect 1.1.x (which doesn't store the MIME type) and early 2.0 (which also didn't), but that does mean it is something the upgrader should fix.

As far as the CAPTCHA goes, it should always be issued with the correct header?

Offline GL700Wing

  • Full Member
  • ***
  • Posts: 485
  • Gender: Female
Re: Problem with avatars and attachments in IE after installing 2.0.6
« Reply #42 on: November 06, 2013, 08:41:19 AM »
Ahhhh, that makes sense, though that should primarily only affect 1.1.x (which doesn't store the MIME type) and early 2.0 (which also didn't), ...
I only upgraded from 1.1.18 to 2.0.4 a few months ago and I noticed when I checked the 1.1.18 database a short time ago that the 'mime_type' field wasn't in the 'smf_attachments' table - I figure you'd know when it was introduced to 2.0.  Only recent attachments had the 'mime_type' field populated in the 'smf_attachments' table in my 2.0.6 database.

... but that does mean it is something the upgrader should fix.
Does that mean I should also set the 'mime_type' for all attachment types (eg, pdf, txt, zip. etc)?

As far as the CAPTCHA goes, it should always be issued with the correct header?
I don't know - I don't use CAPTCHA.  I only used that link as a reference because it helped me understand the cause of the issue.
Life doesn't have to be perfect to be wonderful ...

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 72,340
Re: Problem with avatars and attachments in IE after installing 2.0.6
« Reply #43 on: November 06, 2013, 08:46:10 AM »
Quote
Does that mean I should also set the 'mime_type' for all attachment types (eg, pdf, txt, zip. etc)?

It really matters for images, but isn't so important for the non image types. I forget whether SMF itself even bothers for those.

Offline GL700Wing

  • Full Member
  • ***
  • Posts: 485
  • Gender: Female
Re: Problem with avatars and attachments in IE after installing 2.0.6
« Reply #44 on: November 06, 2013, 08:54:17 AM »
Quote
Does that mean I should also set the 'mime_type' for all attachment types (eg, pdf, txt, zip. etc)?

It really matters for images, but isn't so important for the non image types. I forget whether SMF itself even bothers for those.
Thanks for the info - I won't worry about updating the MIME type for non-image file types at this time.
« Last Edit: November 06, 2013, 09:32:38 AM by GL700Wing »
Life doesn't have to be perfect to be wonderful ...

Offline Scott Hamilton

  • Charter Member
  • Semi-Newbie
  • *
  • Posts: 34
  • Gender: Male
    • FordPinto.com
Re: Problem with avatars and attachments in IE after installing 2.0.6
« Reply #45 on: February 17, 2014, 03:15:34 PM »
I got no idea why they're failing in the first place ;)
My forum users have also experienced the same issues with IE not always displaying images since the upgrade to 2.0.6 and commenting out the following line in index.php fixed the issue in a few posts I checked:
Code: [Select]
header('X-Content-Type-Options: nosniff');
After reading this thread (and 2.0.6 upgrade - simple portal block issue) I did a bit of Googling and found the following: IE9 and IE10 does not display CAPTCHA image sometimes and JIRA will not display images with the wrong MIME type in IE due to nosniff header

Based on the information in the these two posts about the issue relating to the incorrect MIME type I then checked the value of 'mime_type' in the 'smf_attachment's table for the images that would not display with 'nosniff' enabled and discovered that it was empty.  As the images were 'jpg' images I updated the 'mime_type' field with the value 'image/jpeg' (and re-enabled 'nosniff' in index.php) and after refreshing the page the images displayed!

I then ran the following SQL commands against my database (after making a backup first!) for the different image types and IE is now behaving itself!

UPDATE `smf_attachments` SET `mime_type` = 'image/bmp' WHERE `fileext` = 'bmp' AND `mime_type` = '';
UPDATE `smf_attachments` SET `mime_type` = 'image/gif' WHERE `fileext` = 'gif' AND `mime_type` = '';
UPDATE `smf_attachments` SET `mime_type` = 'image/jpeg' WHERE `fileext` = 'jpg' AND `mime_type` = '';
UPDATE `smf_attachments` SET `mime_type` = 'image/png' WHERE `fileext` = 'png' AND `mime_type` = '';

Wow, GL700Wing- this worked great! I ran you query's on my db and everything is working correctly again. Thank you!

Been running the software since the YaBBSE days.. Had this issue for a while now and could not figure it out, you are the man.

Scott
Been with SMF since the YabbSE Days...
http://www.fordpinto.com