Post and PM Inline Attachments

Started by dougiefresh, July 26, 2014, 09:14:08 PM

Previous topic - Next topic

Arantor

Yes, I rather suspect that was the cause.

So at this point, this makes me wonder if the mod is properly serving Content-Type because that line indicates IE is supposed to check what the supplied data from the server was, against what the server said it was sending.

I still haven't checked the mod but this could be mod related.

RSI

Any update on this?

I went ahead and bit the bullet and did the SMF 2.0.9 upgrade after removing all of the hooks and did a clean install keeping all data intact. I then tried installing this mod again and it still wont display the in-line images in IE8 to IE11 so it is this mod.

Anyway, I then removed it and installed the ILA mod and it works correctly with IE. The only problem is it wont work with the PM Attachments mod and the HS4SMF v0.8 mod is a little out of date. Some of the selected features via the admin panel don't work correctly anymore.

dougiefresh

Quote from: Arantor on January 20, 2015, 10:59:49 AM
Yes, I rather suspect that was the cause.

So at this point, this makes me wonder if the mod is properly serving Content-Type because that line indicates IE is supposed to check what the supplied data from the server was, against what the server said it was sending.

I still haven't checked the mod but this could be mod related.
Well, I am using SMF's native attachment handling code in order to serve the attachments to the user.  I haven't made any adjustments to the attachment serving code in my mod, so I don't understand what is going on here....  As a temporary measure, I'm going to add an option to the mod to disable the nosniff setting done by the forum.

I have a feeling I'm going to need to change the headers sent for the mod to reflect the actual filetype instead of the application/octetstream type that SMF sends, which is what back to SMF 2.0.5 has in the code....

Arantor

No, SMF only uses application/octetstream if it's not an image. If it is an image and can be detected as such, the proper image MIME type is used instead.

This is what the problem is; IE is detecting a mismatch between what the declared MIME type is and what it discovers when it tries to open the file.

This could suggest there is something about the saving part that is not being handled completely.

RSI

Here's a link which explains it. It started with IE8

https://technet.microsoft.com/en-us/library/dd919181%28v=WS.10%29.aspx

MIME-handling changes. The following changes are made to the Internet Explorer 8 Multipurpose Internet Mail Extensions (MIME)-type detection algorithms:

Restrict MIME-type detection. Internet Explorer 8 prevents the detection, or data sniffing, of files with image/* MIME content types into HTML or script. If a file contains script and the server declares that it is an image file, Internet Explorer 8 does not run the embedded script.

Prevent MIME-type detection. Web applications now can prevent MIME-type detection. Sending the new X-Content-Type-Options: nosniff header prevents Internet Explorer from using MIME-type detection to change the server-declared content type.

Force save. For Web applications that need to serve untrusted HTML files, Internet Explorer 8 contains a mechanism that forces users to save untrusted HTML files locally before opening to help prevent the untrusted content from compromising site security.

Arantor

Yes, yes I know this much. I'm the guy who inserted the nosniff header *into* SMF in the first place (because I'm formerly of the dev team). And of course this is how I knew to suggest whether that was a possible cause.

The question is why the attachment serving is not sending the correct MIME type, which suggests the wrong MIME type is being saved in the first place, which would potentially be a mod issue but I have not had the time or energy to figure out what's wrong with the mod (seeing how it's not mine)

shazoo!

#66
Quote from: saurabh1938 on August 23, 2014, 06:15:54 AM
Quote from: dougiefresh on August 22, 2014, 07:33:19 PM
Quote from: saurabh1938 on August 20, 2014, 06:28:57 PM
Hi, would you be able to look at the issue of this mod not working on Chrome or Firefox. When I click on Insert Attachment, nothing happens but on IE it works like a charm
I tested it in FireFox during development of the mod, and tested it in Chrome just now.  I don't see where it doesn't function properly.  When I press the "Insert Attachment" link beside the attachment, the text "[attachment=0][/attachment]" gets inserted into the post....


Hi, I appreciate you looked into the issue, but I tested this on 3-4 machines, it is only working on IE but not on Firefox, Safari, Chrome... I don't know what's happening but issue persists for all the browsers other than IE.

Thanks,
Saurabh
Quote from: dougiefresh on August 24, 2014, 06:34:09 AM
I would love to fix it, but I can't fix something that I can't reproduce.....  When you click the More Attachments link, does it work?  If not, that suggests that Javascript isn't enabled for your browser....
I'm experiencing the same issue with Chrome and Firefox, but it works great in IE

When I click on the insert attachment links, nothing happens.

If I inspect element in Chrome, I see the following in the console (not sure if this is helpful or not... it may not even be applicable to the issue):

JQMIGRATE: jQuery.fn.live() is deprecated
jquery.caret.min.js:2 'Range.detach' is now a no-op, as per DOM (http://dom.spec.whatwg.org/#dom-range-detach).

Also, if I try to manually add the BBC code in the message in Chrome or Firefox:

[attachment=0][/attachment]

It will show in the preview if I toggle the format, but is removed as soon as I hit save

RSI

Quote from: shazoo! on February 01, 2015, 09:57:45 AM
this mod not working on Chrome or Firefox. When I click on Insert Attachment, nothing happens but on IE it works like a charm

What, that makes no sense at all...

shazoo!

Quote from: RSI on February 06, 2015, 05:43:34 PM
Quote from: shazoo! on February 01, 2015, 09:57:45 AM
this mod not working on Chrome or Firefox. When I click on Insert Attachment, nothing happens but on IE it works like a charm

What, that makes no sense at all...
Agreed, but that's what I'm experiencing

RSI

QuoteAgreed, but that's what I'm experiencing

What version of SMF are you using? With a clean v2.09 install it works fine on all other browser's except IE8 thru IE11.

You either have an older SMF version or it's related to other mods you have installed.


RSI

You know, it might be better to just wait until the SMF production version of v2.1 is released. I never planed on upgrading from v2.07 to v2.09 and I only did it because I was trying to figure out want was going on with this mod. After playing with v2.1 b1 this weekend and the fact it's making the switch to HTML5 changes everything. This browser compatibility thing may be eliminated anyway.

dougiefresh

#71
Uploaded v2.6 - February 13th, 2014
o Added an option to disable the nosniff header until a better solution is found....
o Fixed a bug in the Post.template.php and PersonalMessage.template.php templates regarding adding more attachments.
o Fixed a bug that added "Insert Attachment 1" where "Insert Attachment 2" should have been.




@shazoo!: I have managed to duplicate your bug report and have corrected the bug within the mod.  Thank you for the bug report!

Everybody: I can no longer update the first post in my threads....

josx2

sorry for the total newb question (i'm just getting started w/ SMF)...I've got v.2.5 of this installed on my forum.  How do I go about updating the package to 2.6?  This is my first update for a package I have installed, so I'm clueless.   I tried searching for upgrade instructions in here & on google & no luck.  Don't know if I can just install on top of my 2.5, or if I gotta remove 2.5 first.

Thx for the help.

dougiefresh

You will have to remove v2.5 first, then you will be able to install v2.6 on your forum.  Hope this helps!

josx2


ChILd_ReBoRn

the problem is that the upload script generates attachment names as in attachment 0, attachment 2, attachment 3... The "1" is missing, and when you press post, the last attachment  goes bust. The solution is to change the attachment numbers IN POST  in order 0, 1, 2, 3, 4.....Then it works like a charm

dougiefresh

Hmmm.... I'll look into this bug report....

ChILd_ReBoRn


dougiefresh

Uploaded v2.7 - March 12th, 2015
o Changed some code to correctly count the number of existing attachments.




@ChILd_ReBoRn:  Thanks for the bug report.  I wasn't able to reproduce the bug with only one attachment, but with two, the bug appeared.  The update should fix the bug.  I apologize for taking so long, as I've been working WAY too many works at work....

ChILd_ReBoRn

I just restored my forum to an earlier backup, and I tried to reinstall your mod, and I got a bunch of errors. I haven't had nay problems last time I installed them. Here is the print scr of some errors... (never mind the language.. the red ones are bad :))

word "zamijeni" means "replace"
word "Neuspješno" means "failed"

Advertisement: