Internet Explorer May Not Use the Expected MIME Type for Uploaded Files (815455)



The information in this article applies to:

  • Microsoft Internet Explorer 6.0, when used with:
    • the operating system: Microsoft Windows Server 2003
    • the operating system: Microsoft Windows XP
    • the operating system: Microsoft Windows 2000
    • the operating system: Microsoft Windows NT 4.0 SP6
    • the operating system: Microsoft Windows Millennium Edition
    • the operating system: Microsoft Windows 98 Second Edition
    • the operating system: Microsoft Windows 98

SYMPTOMS

When you use Internet Explorer to upload (or post) a file to a Web server by using a form on a Web page, the file may not be uploaded with the expected MIME type. (The MIME type is also known as the content type or the media type.) For example, if you upload an .asx file (a Microsoft Windows Media audio or video playlist), a network trace may show that the Content-type header used is "text/html" instead of "video/x-ms-asf." For example, a typical abstract of a network trace may contain data that is similar to this:
POST /upload.asp 
Content-Type: multipart/form-data;
... 
-----------------------------7d3376d1b08bc 
Content-Disposition: form-data; 
name="filUpload"; 
filename="C:\example.asx" 
Content-Type : text/html
This behavior may be a problem for receiving programs that rely on the Content-type header to process the uploaded file.

CAUSE

An .asx file is typically a plain-text file that contains XML or HTML tags. A text file that contains any of the following tags is assigned a MIME type of "text/html" by Internet Explorer:

<?XML>
<A HREF>
<BODY>
<HEAD>
<HTML>
<IMG>
<PLAINTEXT>
<PRE>
<SCRIPT>
<TABLE>
<TITLE>

The MIME type that is detected by Internet Explorer for .asx files is frequently "text/html" because .asx files typically contain text and HTML tags such as <TITLE>.

Internet Explorer examines the actual contents that are associated with a local file to determine the MIME type. If the contents of the file do not permit Internet Explorer to determine the MIME type, the file name extension and associations or registered programs are used to determine the MIME type.

MORE INFORMATION

Form-based file upload in HTML is described in Request for Comments (RFC) document 1867. To view this document, visit the following Internet Engineering Task Force (IETF) Web site: Microsoft provides third-party contact information to help you find technical support. This contact information may change without notice. Microsoft does not guarantee the accuracy of this third-party contact information.

For additional information about MIME-type detection in Internet Explorer, visit the following Microsoft Web site:

Modification Type:MinorLast Reviewed:12/3/2004
Keywords:kbprb KB815455