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 ... |
Get Sams Teach Yourself ColdFusion® in 21 Days now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.