Uploading files with ColdFusion

Sam posted some CF code that gives you the ability to upload a file to a web server without using CFFILE (ie: he uses Java instead): Handling file uploads without CFFILE.

On a related note, Oreilly has an article (Using the Jakarta Commons) that (will) introduce(s) each component in the Jakarta Commons library. Probably would have been better to use the tried and tested FileUpload component from the Commons lib, but that would have required the jar file be present in ColdFusion’s classpath.

One thought on “Uploading files with ColdFusion”

  1. Aaron,

    Thanks for the mention. Remember that the problem being solved is specifically how to handle uploads on a shared host where cffile is turned off–which presumably will mean createObject is also turned off as it’s also “dangerous”.

    Also note that CFMX is always going to process the upload for us and store the file in a temporary file. It then passes to us only the name of the file, which is what I then used to create a reader and read it in line by line. We didn’t have to touch the request data at all.

Leave a Reply to Sam Cancel reply

Your email address will not be published. Required fields are marked *