House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home /  Groups /  ColdFusion Talk (CF-Talk)

ColdFusion , Safari, and No Form Variable if Input Type='File'?

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
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
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Matthew Reinbold
05/26/2008 04:58 PM

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

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Didgiman
05/26/2008 05:07 PM

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 -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Will Tomlinson
05/26/2008 05:10 PM

> 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


<< Previous Thread Today's Threads Next Thread >>

Search cf-talk

May 24, 2012

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
     1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31     

Designer, Developer and mobile workflow conference