Creating a file upload page using ColdFusion
File upload pages allow users to select files from their local hard drive and upload them to a server via the web browser. Building a file upload page with ColdFusion is quick and easy using the upload action of the CFFILE tag. CFFILE is a ColdFusion tag that can perform a variety of file management related actions such as reading, writing, moving, renaming and uploading files.
For the purpose of this TechNote, we will focus on the upload action of this tag and provide Dreamweaver MX instructions for creating a simple ColdFusion file upload page. Although the step-by-step instructions provided in this TechNote pertain to the Dreamweaver interface, the resulting code which is listed at the bottom can be customized for use in Dreamweaver UltraDev 4 as well. The ColdFusion code used in the file upload example will work with versions 5 and above of the ColdFusion Server.
Note: Macromedia Exchange for Dreamweaver lists the latest extensions available for download. In addition to the method provided in this TechNote, you may also want to visit the Exchange to search for related extensions.
Because allowing file uploads can potentially compromise server security, it is a good idea to evaluate possible risks before implementing file uploads in a web application. There is no foolproof way to ensure a secure file upload in a web application, although through careful design, it is possible to reduce your risk.
Some suggestions for protecting server security: