Access the answers to your technology questions today.
Subscribe Now
30-day free trial. Register in 60 seconds.
What Makes Experts Exchange Unique?
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.
Try it out and discover for yourself.
Subscribe Now
30-day free trial. Register in 60 seconds.
Join the Community
Give a Little. Get a Lot.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Join the Community
by: trailblazzyr55Posted on 2008-09-11 at 13:05:39ID: 22454109
It looks like you have an argument to your method for the form field and unless you are doing any manipulation with the neo-temp temporary file, this really isn't needed unless you want to check for length to see if an image was infact being submitted. However I wouldn't name it the same as your form field to avoid conflicts.
it really doesn't matter how many levels deep your file upload is, the form scope persists for the request and is available throughout your application code, therefore simply specifying the form field name in the cffile "fileField" attribute should suffice. I would check for naming conflicts and that your method is being called after the form is submitted.
Also since you are specifying all images in your cffile "accept" attribute I would wrap the cffile call with a try/catch, since cffile will always throw a hard error when a non-image type is attempting to upload.
So I would remove:
<cfargument name="fileLoc" required="yes" hint="send me the file field.">
And wrap your file upload in a try/catch to handle non-image types gracefully
-tb55