User Guide

320 Chapter 17 Managing Files on the Server
The user can enter a file path or browse the system and pick a file to send.
To create an action page to upload the file:
1 Create a new file in ColdFusion Studio.
2 Modify the file so that it appears as follows:
<html>
<head>
<title>Upload File</title>
</head>
<body>
<h2>Upload File</h2>
<cffile action="upload"
destination="c:\temp"
nameConflict="overwrite"
fileField="Form.FiletoUpload">
<cfoutput>
You uploaded the file #cffile.ClientFileName#.#cffile.ClientFileExt#
successfully to
#cffile.ServerDirectory#\#cffile.ServerFileName#.#cffile.
ServerFileExt#.
</cfoutput>
</body>
</html>
3 Change the following line to point to an appropriate location on your server:
destination="c:\temp"
4 Save the file as uploadfileaction.cfm in myapps under the Web root directory.
5View
uploadfileform.cfm in your browser, enter values and submit the form.
The file you specified is uploaded.