In FireFox, you can dynamically set the EncType of a form element to be "multipart/form-data" for file uploads; however, this does not work in Internet Explorer (IE). Apparently in IE, you have to set the "encoding" of the form rather than the "enctype". The good news is, you can set both values without concern and this will take care of the problem:

This Example is using JQuery to Acheive this most wonderous solution:

(Make Sure you Have the JQuery Library installed on your page/form)

<script>

     // Using jQuery, set both the enctype and the encoding
     // attributes to be multipart/form-data.
     $( "form#upload-form" )
     .attr( "enctype", "multipart/form-data" )
     .attr( "encoding", "multipart/form-data" )
    ;
</script>

<form name="upload-form" id='upload-form'>

...form contents...

</form>

 

About This Tutorial
Author: James Harvey
Skill Level: Beginner 
 
 
 
Platforms Tested: CFMX,CF8
Total Views: 12,573
Submission Date: October 17, 2009
Last Update Date: October 17, 2009
All Tutorials By This Autor: 12
Discuss This Tutorial
Advertisement

Sponsored By...
Powered By...