Thanks for the replies..

I know about trimming the file field.. but that doesn't seem to be the
problem. You see, the value of Form.theFile is set to
"C:\WINNT\ACF393.tmp" even if no file has been selected!

Go to this URL and try it for yourself:
http://www.newgency.com/test/filetest.cfm

If anyone has access to Mac, could you try submitting the form without
actually browsing your hard drive and selecting a file... when I do
this it still gives me a temp file name, but only on the Mac. I'll
take the code down soon, I don't want it hanging around on my server
for too long...

Am I the only one who experiences this problem?

I've now changed the code to this:

<CFIF isDefined("Form.fieldnames")>
<cfoutput>The value of the file variable is: [#Trim(Form.thefile)#]<br>
The length of this variable is: [#Len(Trim(Form.theFile))#]</cfoutput>

</CFIF>
<form action="filetest.cfm" method="post" enctype="multipart/form-data">
<input type="file" name="thefile">
<input type="submit">
</form>


Thursday, June 12, 2003, 6:05:31 PM, you wrote:

SO> First off, you need to use TRIM when working with macs as it adds stuff to
SO> the form values, so #TRIM(Form.theFile)#


SO> So CF is probbalby look at "C:\WINNT\ACF393.tmp " rather than
SO> "C:\WINNT\ACF393.tmp"

SO> If your checking for anything in the form you need to use
SO> #Len(Trim(Form.theFile))# to clear out the extra bytes

SO> Steve

SO> -----Original Message-----
SO> From: [EMAIL PROTECTED]
SO> [mailto:[EMAIL PROTECTED] Behalf Of Ryan Sabir
SO> Sent: Thursday, 12 June 2003 6:02 PM
SO> To: CFAussie Mailing List
SO> Subject: [cfaussie] File upload on Mac


SO> Hi all,

SO> Got a strange problem with uploading a file from a mac browser.

SO> Uploading works fine, but in some cases I want to submit the form and
SO> need to then detect whether the user actually selected a file or not.

SO> Regarding the simple CF code I have reproduced below...

SO> On the PC:
SO> Submit the form with a file selected, the value of the 'Form.thefile'
SO> variable is something like : "C:\WINNT\ACF393.tmp"
SO> Submit the form below with no file selected and then 'Form.thefile' is
SO> en empty string

SO> On the Mac:
SO> Submit the form with a file selected, the value of the 'Form.thefile'
SO> variable is something like : "C:\WINNT\ACF393.tmp"
SO> Submit the form below with no file selected and then 'Form.thefile' is
SO> STILL something like : "C:\WINNT\ACF393.tmp"

SO> How can I detect on the Mac if a file has been actually selected from
SO> a file upload input box? There is no actual file created at the
SO> location "C:\WINNT\ACF393.tmp" in either case, just to make things
SO> fun.

SO> CF code reproduced below (the file is called 'filetest.cfm'):

SO> <CFIF isDefined("Form.fieldnames")>
SO> <cfoutput>Thefile = [#Form.thefile#]</cfoutput>
SO> </CFIF>
SO> <form action="filetest.cfm" method="post" enctype="multipart/form-data">
SO> <input type="file" name="thefile">
SO> <input type="submit">
SO> </form>

SO> thanks

SO> -----------------------
SO> Ryan Sabir
SO> Newgency Pty Ltd
SO> 2a Broughton St
SO> Paddington 2021
SO> Sydney, Australia
SO> Ph (02) 9331 2133
SO> Fax (02) 9331 5199
SO> Mobile: 0411 512 454
SO> http://www.newgency.com/index.cfm?referer=rysig


SO> ---
SO> You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
SO> To unsubscribe send a blank email to [EMAIL PROTECTED]

SO> MX Downunder AsiaPac DevCon - http://mxdu.com/


SO> ---
SO> You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
SO> To unsubscribe send a blank email to [EMAIL PROTECTED]

SO> MX Downunder AsiaPac DevCon - http://mxdu.com/


-----------------------
Ryan Sabir
Newgency Pty Ltd
2a Broughton St
Paddington 2021
Sydney, Australia
Ph (02) 9331 2133
Fax (02) 9331 5199
Mobile: 0411 512 454
http://www.newgency.com/index.cfm?referer=rysig 


---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

MX Downunder AsiaPac DevCon - http://mxdu.com/

Reply via email to