ColdFusion Tutorial

Upload files

Syntax for upload files:
<input type="file" name="field_name">

This form is unlike other forms, because it has not a value attribute. This form is is gettable and not settable. That means the value only can be entered by the user.

In an upload form there must also be the enctype tag.
The enctype="multipart/form-data" telling the server that the form include a file being uploaded in addition to any data entered in the form.

When a file is selected, the full path will be visible in the upload field. After submitting the file will be send to the server where it can be processed.

The basic upload image form:

Notice the use of "cgi.script_name" that will submit the form to the same page.

<form action="<cfoutput>#cgi.script_name#</cfoutput>" method="post"
enctype="multipart/form-data">
  File:
  <input type="file" name="File_To_Upload" />
  <br />
  <input name="submit" type="submit" value="Upload File" />
</form>

The upload form:




The dialog box:



ColdFusion Tutorial test

Upload files

No test is available or implemented for this ColdFusion Tutorial.

No User Comments.

No User Comments, be the first one to write your comments?

Add your comments

Your Name*:
Your Email:
Site URL:
Site Name:
Comemt Title*:
Your Comment*:
Key Phrase*:
Je8
Your IP Address: 38.103.63.62
 

ScandicWeb is own by Scandic Systems LTD [UK] Company No. 5984000. All other trademarks and copyrights are the property of their respective holders.

[Home [Site Map [Privacy Statement [Site Feedback] [About ScandicWeb]


[ColdFusion [Flash [Search Engine Optimization [Graphics [Cascading Style Sheets (CSS) [JavaScript (JS) [Software]

Partner sites: ScandicSoft


Server time: 19. November 2008 Wednesday