Web Analytics Made Easy -
StatCounter Can't upload MS Word Docs from IE7 - CodingForum

Announcement

Collapse
No announcement yet.

Can't upload MS Word Docs from IE7

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Can't upload MS Word Docs from IE7

    Is there some reason why uploading a MS Word Document would tell the server that the file has a mime type of "application/octet-stream"????? (In IE only)

    Trying to filter so that only Word Documents, PDFs, and Jpegs get through - but when I test in IE it doesn't send the mime type headers correctly for the file "example.doc"

    Two things that might help:

    1. - I don't have MS Word installed, not sure if IE is trying to verify that it is in fact a word document through some of MS's evil work
    2. - Of course it works in all other browsers, I'm guessing nobody is surprised

    Is it safe to just filter files by file extension? Since the mime type is browser set, is it any safer than filtering by mime type?

    Thanks soooo much in advance & happy Easter to you all who get down like that.

  • #2
    Is it safe to just filter files by file extension? Since the mime type is browser set, is it any safer than filtering by mime type?
    Could you post your code used for filter?
    Digitalocean Cloud Hosting (Referral link - get $10 free credit) Fameco

    Comment


    • #3
      Originally posted by abduraooft View Post
      Could you post your code used for filter?
      Here's the code checking only mime types:

      if (
      (
      ($_FILES["uploaded_file"]["type"] == "image/jpeg")||
      ($_FILES["uploaded_file"]["type"] == "image/pjpeg"))||
      ($_FILES["uploaded_file"]["type"] == "application/pdf"))||
      ($_FILES["uploaded_file"]["type"] == "application/msword"))
      )

      && ($_FILES["uploaded_file"]["size"] < 4000000)
      )
      {
      //do more stuff here
      }


      Not sure why IE7 doesn't pass the "application/msword" mime type to the server, if you want me to post the whole file (about 200 lines long) I'd be happy to...

      Thanks for the look!

      Comment

      Working...
      X