• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Day 18. Working with Files and Directories > Using <CFFILE> to Accept Uploads

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 the full pathname here or use the "browse" button to find it.<P>
13: <INPUT TYPE=FILE NAME="FileName" SIZE="50" ><P>
14: <INPUT TYPE=SUBMIT VALUE="Upload This Photo">
15: </FORM>
16: </BODY>
17: </HTML>

					  


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint