Easy file uploading with Coldfusion

File uploading seems to be very basic feature that of every web application. Coldfusion offers very easy way for uploading file on the server. Single tag “cffile” for multiple needs.

<cffile action=”upload” destination=”c:\temp\” nameConflict=”overwrite” fileField=”Form.FiletoUpload”>

action
-Specify different values for it in this case upload

destination
-Where your file will get saved.

nameConflict
-This attributes tell the coldfusion when file is available on server. Should it be overwrite, skip, or need to create with new name

fileField
-Name of the files that has to be uploaded.

Also in html form part, you need to define form enctype=”multipart/form-data”. This tell coldfusion that file has been submitted by web browser.

-Create html form for file uploading
-Create cfm page  for your coldfusion scripting
-Check wheater form has been submitted or not
-Submitted then run the cffile tag

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: