File Upload Validation
Hi All,
I have a form with an element of input type file to upload a file from the user's box to the server's box, however after clicking upload I need to perform a couple of validations. What I need actually from this form is the filename that is to be uploaded (emphasis on 'that is to be uploaded' and not 'uploaded').
For example:
1. I need to validate that the filename does not contain spaces before writing it to the server's file system.
2. Has a certain extension name...
Since it's only after an upload that CF provides certain return vars like serverFileName..., it's not possible to retrieve the filename before upload. Trying to get the filename from the form is also not possible 'cos the name assigned after CF processed the form is of name pattern "tmp-02.upload" 02 being some random generated number, actual filename is "documentanalysis.jrxml". Don't want to use Javascript as this is unreliable since it can be disabled (this app is an intranet app). Other CFFILE action types don't provide return vars (thought of a workaround using another action type).
Could anyone please help or point me in the right direction to get this resolved? Thanks.
