O'Reilly logo

Sams Teach Yourself ColdFusion® in 21 Days by Charles Mohnike

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using <CFFILE> to Accept Uploads

The <CFFILE> tag is most often used on an ACTION page, getting its necessary data from a form like the one illustrated in Figure 18.1. To get a feel for the sort of data the tag needs, take a look at Listing 18.1, which contains the code that created the form in Figure 18.1.

Listing 18.1 The Code for upload_form.cfm, as Illustrated in Figure 18.1
 1: <HTML> 2: <HEAD> 3: <TITLE>Upload Your Photos of UFO Sightings</TITLE> 4: </HEAD> 5: <BODY> 6: <H1>Upload Your Photos of UFO Sightings</H1> 7: 8: This page allows you to send us your personal photos of UFO sightings.<P> 9: <HR> 10: <FORM ACTION="upload_action.cfm" ENCTYPE="multipart/form-data" METHOD="post"> 11: Where is your photo on your hard drive?<BR> 12: Enter ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required