File Is Not Uploaded with the <INPUT TYPE=FILE> Tag (277830)



The information in this article applies to:

  • Microsoft Internet Explorer (Programming) 5.5

This article was previously published under Q277830

SYMPTOMS

When you use Internet Explorer 5.5 and you try to upload a file by using the <INPUT TYPE=FILE> tag in a Post form in an Extensible Stylesheet Language (XSL) style sheet, the file is not uploaded.

RESOLUTION

There are two possible workarounds for this problem. The first workaround is to perform the Extensible Markup Language (XML) or XSL transformation on the server and return only static Hypertext Transfer Protocol (HTML).

Alternatively, you can perform the transformation on the client and populate a <Div> element on the page. View the following HTML sample code for an example about how to do this:
<html><body onload="create()">
<script language=javascript>
  function create() {

	var xml = new ActiveXObject("MICROSOFT.XMLDOM");
	var xsl = new ActiveXObject("MICROSOFT.XMLDOM");
	xsl.async = false;
	xml.async = false;
	xml.load('your_xml_file.xml');
	xsl.load('your_xsl_file.xsl');

	
	str_res = xml.transformNode(xsl);

	mydiv.innerHTML = str_res;

  }

</script>

<div id=mydiv></div>

</body>
				
You must modify the XML/XSL transform to return only the <Form> element when you move the transform to the client.

XML file:
<?xml version='1.0'?>
    <XML>
    </XML>
				
XSL file:
<?xml version='1.0'?>
   <xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">

   <xsl:template match="/">

   	<FORM action="upload.asp" method="post"    enctype="multipart/form-data">
		<INPUT type="file" name="myfile" size="25" />
		<INPUT type="submit" />
	</FORM>
   </xsl:template>
   </xsl:stylesheet>
				

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.

Modification Type:MajorLast Reviewed:10/2/2003
Keywords:kbcode kbenv kbpending kbprb KB277830