---------- Original Message ----------------------------------
From: "Claremont, Timothy" <[EMAIL PROTECTED]>

>Can anyone tell me if I can filter the input on a CFFILE input screen? I
>know I can filter what the server will accept, and throw an error, but I
>would like to prevent users from even attempting to upload anything but
>an Excel file if possible.


I haven't tested this, but I believe you could use javascript validation to ensure 
that the last 4 characters are ".xls".

However,
1) I believe Macs don't always add the extension to file names, so if there isn't an 
XLS extension on the Excel file, your validation will fail.
2) This only validates that the extension is .xls.  If they have a non-Excel file 
named with the .xls extension, it will pass validation even though it's not an Excel 
file.

As long as you still use server-side validation on the CFFILE, you should catch #2.

Personally, I don't bother with doing that on the client-side, since it's not really 
reliable.  File uploads I just validate on the server.

Scott
--------------------------------
Scott Brady
http://www.scottbrady.net/
 
             
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

Get the mailserver that powers this list at 
http://www.coolfusion.com

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to