problem with file uploads on a MAC
I was hoping I could get some help on the list.Sort of at a loss for this one.I am aware there are know issues with the MAC and IE doing for uploads.I have two upload boxes on a page.The first is required and the second is optional.If a user selects both upload options, my code runs through fine.However, because of the temp file issue with MACS, if the user does not select a file for the second option, code errors out because it tries an upload. Has anybody had this issue before?Do you know a way around it? Let me know [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: problem with file uploads on a MAC
You need to make sure you trim any 'file' field. IE on a Mac (can't remember which version) always seems to add a Linefeed Character when the 'file' field is blank -Original Message- From: Michael Hodgdon [mailto:[EMAIL PROTECTED] Sent: 20 October 2003 16:24 To: CF-Talk Subject: problem with file uploads on a MAC I was hoping I could get some help on the list.Sort of at a loss for this one.I am aware there are know issues with the MAC and IE doing for uploads.I have two upload boxes on a page.The first is required and the second is optional.If a user selects both upload options, my code runs through fine.However, because of the temp file issue with MACS, if the user does not select a file for the second option, code errors out because it tries an upload. Has anybody had this issue before?Do you know a way around it? Let me know _ [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: problem with file uploads on a MAC
try a CFIF Len(Trim(Form.OptionalUploadField)) CFFILE /CFIF HTH -Original Message- From: Michael Hodgdon [mailto:[EMAIL PROTECTED] Sent: Monday, October 20, 2003 16:24 To: CF-Talk Subject: problem with file uploads on a MAC I was hoping I could get some help on the list.Sort of at a loss for this one.I am aware there are know issues with the MAC and IE doing for uploads.I have two upload boxes on a page.The first is required and the second is optional.If a user selects both upload options, my code runs through fine.However, because of the temp file issue with MACS, if the user does not select a file for the second option, code errors out because it tries an upload. Has anybody had this issue before?Do you know a way around it? Let me know _ [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: problem with file uploads on a MAC
Can't you test the upload form field?? IF (LenTrim((form.fileUpload1)) EQ 0) OR (Trim(form.fileUpload) EQ ) upload ELSE dont upload.. -Original Message- From: Michael Hodgdon [mailto:[EMAIL PROTECTED] Sent: Monday, October 20, 2003 11:24 AM To: CF-Talk Subject: problem with file uploads on a MAC I was hoping I could get some help on the list.Sort of at a loss for this one.I am aware there are know issues with the MAC and IE doing for uploads.I have two upload boxes on a page.The first is required and the second is optional.If a user selects both upload options, my code runs through fine.However, because of the temp file issue with MACS, if the user does not select a file for the second option, code errors out because it tries an upload. Has anybody had this issue before?Do you know a way around it? Let me know _ [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: problem with file uploads on a MAC
Ok.That is what I am doing.My code on the action page looks like this cfset variables.mandupload = trim(FORM.mandupload) cfset variables.optupload = trim(FORM.optupload) cfifvariables.mandupload NEQ cffile action="" filefield=mandupload /cfif cfifvariables.optupload NEQ cffile action="" filefield=optupload /cfif Then, in the cffile tags I am using the to variables set to the trimmed form field values.The problem is that on the action page, if the user did not select the optional upload, it still returns a temporary file path.So in the debugging information at the bottom of my page, I get the following form variables: Form Variables: mandupload = /tmp/3445502 optupload = /tmp/309992992 On any other browser / OS, if the user does not select the optional form field, nothing gets sent accross. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, October 20, 2003 12:52 PM To: CF-Talk Subject: RE: problem with file uploads on a MAC You need to make sure you trim any 'file' field. IE on a Mac (can't remember which version) always seems to add a Linefeed Character when the 'file' field is blank -Original Message- From: Michael Hodgdon [mailto:[EMAIL PROTECTED] Sent: 20 October 2003 16:24 To: CF-Talk Subject: problem with file uploads on a MAC I was hoping I could get some help on the list.Sort of at a loss for this one.I am aware there are know issues with the MAC and IE doing for uploads.I have two upload boxes on a page.The first is required and the second is optional.If a user selects both upload options, my code runs through fine.However, because of the temp file issue with MACS, if the user does not select a file for the second option, code errors out because it tries an upload. Has anybody had this issue before?Do you know a way around it? Let me know _ [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Re: problem with file uploads on a MAC
On Monday, October 20, 2003, at 11:23AM, Michael Hodgdon wrote: I was hoping I could get some help on the list. Sort of at a loss for this one. I am aware there are know issues with the MAC and IE doing for uploads. I have two upload boxes on a page. The first is required and the second is optional. If a user selects both upload options, my code runs through fine. However, because of the temp file issue with MACS, if the user does not select a file for the second option, code errors out because it tries an upload. Has anybody had this issue before? Do you know a way around it? I always do this for each file being uploaded: cfset uploadFailed = false/ cftry cffile... cfcatch cfset uploadFailed = true/ /cfcatch /cftry Basically, instead of erroring out it will set an uploadFailed boolean, which I then can use to programmatically deal with scenarios. [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: problem with file uploads on a MAC
-Original Message- From: Michael Hodgdon [mailto:[EMAIL PROTECTED] Sent: Monday, October 20, 2003 16:24 To: CF-Talk Subject: problem with file uploads on a MAC I was hoping I could get some help on the list.Sort of at a loss for this one.I am aware there are know issues with the MAC and IE doing for uploads.I have two upload boxes on a page.The first is required and the second is optional.If a user selects both upload options, my code runs through fine.However, because of the temp file issue with MACS, if the user does not select a file for the second option, code errors out because it tries an upload. I came across this a while ago when implementing some code to automatically TRIM *all* form fields coming in. The code I have is: cfscript if (IsDefined(form.fieldnames)) { formFields = StructKeyArray(form); for (i=1; i LTE ArrayLen(formFields); i=i+1) { field = formFields[i]; IEMac = (FindNoCase(msie, CGI.HTTP_USER_AGENT) AND FindNoCase(mac, CGI.HTTP_USER_AGENT)); if (NOT (ListFind(filePath,imagePath, field) AND NOT IEMac)) { StructUpdate(form, field, Trim(form[field])); } } } /cfscript The tag's comments say: Trims all form fields automatically (to avoid having to remember later), but *doesn't* trim file upload fields for anything *but* IE/Mac (this browser needs to have uploads trimmed; everything else breaks if trimmed). You'd have to adjust that ListFind() to accomodate whatever naming conventions you have for file upload fields. I'm referring to this code almost as if it's someone else's because I'm currently totally baffled by it not working in our new framework. So I can't completely vouch for it. BUT, it's been working OK in our other sites, so more than likely there's an issue with something in our new framework rather than this technique per se. HTH, Gyrus [EMAIL PROTECTED] http://norlonto.net/gyrus/dev/ PGP key available [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: problem with file uploads on a MAC
Thanks for the help.What is this script doing that a coldfusion trim() function on the form field would not do?The problem seems to be that regardless of the users action, the form field for the optional upload always includes a temporary file.Trimming the form field will simply trim the /tmp/dd33ddl43 value.Is this trim function done before the browser interprets the users request or something? thanks again, appreciate the help. mike Michael S. Haddon Harvard Graduate School of Education, PPE Web Developer P: 617-496-8341 AOL: michaelshodgdon Y!: michaelhodgdon -Original Message- From: Gyrus [mailto:[EMAIL PROTECTED] Sent: Monday, October 20, 2003 2:20 PM To: CF-Talk Subject: RE: problem with file uploads on a MAC -Original Message- From: Michael Hodgdon [mailto:[EMAIL PROTECTED] Sent: Monday, October 20, 2003 16:24 To: CF-Talk Subject: problem with file uploads on a MAC I was hoping I could get some help on the list.Sort of at a loss for this one.I am aware there are know issues with the MAC and IE doing for uploads.I have two upload boxes on a page.The first is required and the second is optional.If a user selects both upload options, my code runs through fine.However, because of the temp file issue with MACS, if the user does not select a file for the second option, code errors out because it tries an upload. I came across this a while ago when implementing some code to automatically TRIM *all* form fields coming in. The code I have is: cfscript if (IsDefined(form.fieldnames)) { formFields = StructKeyArray(form); for (i=1; i LTE ArrayLen(formFields); i=i+1) { field = formFields[i]; IEMac = (FindNoCase(msie, CGI.HTTP_USER_AGENT) AND FindNoCase(mac, CGI.HTTP_USER_AGENT)); if (NOT (ListFind(filePath,imagePath, field) AND NOT IEMac)) { StructUpdate(form, field, Trim(form[field])); } } } /cfscript The tag's comments say: Trims all form fields automatically (to avoid having to remember later), but *doesn't* trim file upload fields for anything *but* IE/Mac (this browser needs to have uploads trimmed; everything else breaks if trimmed). You'd have to adjust that ListFind() to accomodate whatever naming conventions you have for file upload fields. I'm referring to this code almost as if it's someone else's because I'm currently totally baffled by it not working in our new framework. So I can't completely vouch for it. BUT, it's been working OK in our other sites, so more than likely there's an issue with something in our new framework rather than this technique per se. HTH, Gyrus [EMAIL PROTECTED] http://norlonto.net/gyrus/dev/ PGP key available [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]