|
Mailing Lists
|
Home /
Groups /
ColdFusion Talk (CF-Talk)
ColdFusion , Safari, and No Form Variable if Input Type='File'?
I've got the following simple form:Matthew Reinbold 05/26/08 04:58 P Another case of RTFM, I'm afraid...Didgiman 05/26/08 05:07 P > Why is ColdFusion not getting the file information? And if SafariWill Tomlinson 05/26/08 05:10 P I've got the following simple form: -------------------------------------------------------------- <form action="index.cfm?go=Load" method="post" name="LoadForm"> <div>Choose File</div> <input type="file" name="filename"> <input type="submit"/> </form> -------------------------------------------------------------- or (for those that would like to play along at home) a complete standalone example file: =============================================================== <cfparam name="url.go" default="showtheform"> <cfif url.go eq "Load"> <cfdump var="#form#"> <a href="index.cfm">Again?</a> <cfelse> <form action="index.cfm?go=Load" method="post" name="LoadForm"> <div>Choose File</div> <input type="file" name="filename"> <input type="submit"/> </form> </cfif> =============================================================== To help debug, the result of submitting the form is a <cfdump var="#form#"><cfabort />. If the user finds a file on IE, Firefox, etc. and submits it I see the resulting form structure as expected - with the filename of what's chosen. On Safari the result of submitting this html element results in an empty form structure. I've also been able to recreate this using the AIR app Scout browsing to the same app on PC (which makes sense, since Safari and AIR both are using the WebKit HTML engine). Why is ColdFusion not getting the file information? And if Safari isn't passing back the necessary html form field information when type = 'file' how do I code around that behavior? matthew reinbold Creative Principal, Vox Pop Design Another case of RTFM, I'm afraid... From the CF documentation: When you use a cfform tag or an HTML form tag to submit the form with the file to be uploaded, you must specify enctype="multipart/form-data" in the tag On Mon, May 26, 2008 at 10:56 PM, Matthew Reinbold < matthew.reinbold@voxpopdesign.com> wrote: ----- Excess quoted text cut - see Original Post for more ----- > Why is ColdFusion not getting the file information? And if Safari > isn't passing back the necessary html form field information when type > = 'file' how do I code around that behavior? > Yeah, That used to catch me when I first started building file upload tools. The first thing you should think when building these forms is multipart enctype. If you don't, it'll constantly bite your rear and cost you lots of time. Will
|
May 24, 2012
|
Latest Fusion Authority Articles
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||