I have a webform which I and several other people are able to use to upload JPEG images to my website. I test to see if the upload file is a JPEG with this conditional line:
Code:
if ( ( aHTMLFile.PostedFile.ContentType != "image/pjpeg" ) & ( aHTMLFile.PostedFile.ContentType != "image/jpeg" ) ) {
Where "aHTMLFile" is a parameter of type HtmlInputFile passed into the method that validates the type.
However, I have one user who is submitting a JPEG file where this fails. The message I post back indicates that the aHTMLFile.PostedFile.ContentType is "JPEG File", and not either of the two mime types I'm looking for.
I've never seen this type of mime type before. The problem occurs on both his desktop (running IE7) and laptop (running IE6).
Personally I run Firefox with an embedded IE engine (which should be the same renderer as IE7). I've tested it with native FireFox, Safari, and IE. I've also tested it with the out-of-the-box IE7 and had no issues with exactly the same file he is using to upload.
He is using anti-spyware, anti-spam, anti-virus software. Is it possible that one of these programs might be causing the browser to change the mime type?
I don't know how to advise him because I don't know what the problem is.
Any ideas?
Thanks,
- El