[thelist] Sunday Special

.jeff jeff at members.evolt.org
Sun May 26 23:43:01 CDT 2002


<tip type="ColdFusion" author=".jeff">

coldfusion server 5.0 and earlier has some difficulty with macintosh version
of internet explorer when they submit a form with one or more file upload
form fields.

here's the code to fix that (assuming your upload form field is named
"file"):

<cfdirectory action="LIST"
             directory="#GetTempDirectory()#"
             name="gettempdirectory"
             filter="#ReplaceNoCase(Form.File, GetTempDirectory(), "")#">
<cfset filecontents = "">
<cfif Val(gettempdirectory.size[gettempdirectory.recordcount])>
  <cffile action="read" file="#Form.File#" variable="filecontents">
  <cfif gettempdirectory.size[gettempdirectory.recordcount]
    AND filecontents EQ Chr(13) & Chr(10)>
    <cffile action="delete" file="#Form.File#">
    <cfset Form.File = "">
  </cfif>
</cfif>

</tip>

.jeff

http://evolt.org/
jeff at members.evolt.org
http://members.evolt.org/jeff/





More information about the thelist mailing list