Website Domain Registration and Website Hosting - Host a Website Builder
GoWebsite.com provides Domain Registration
Website Hosting, On-Line Shopping Carts,
Blog Hosting, Email Accounts, Security Certificates,
Merchant Accounts & other Website Products.
Free setup! Speak with us anytime: (480) 624-2500

Frequently Asked Questions

How do I use cffile to upload files?

Print this Article
Comment on this Article

Using the ColdFusion tag "cffile" allows you to create a web page that supports uploading files to your Website.

We use security sandboxes for each user to ensure that users cannot upload files outside of their content directory. Also, for security purposes you should always restrict the type of files that can be uploaded to your Website by using the "accept" attribute in the "cffile" tag.

For more information about controlling the type of file uploaded, please see Macromedia’s online documentation.

The following example displays an upload form that uses the "cffile" tag to perform the file upload:

<html>
<head>
<title>Upload File with ColdFusion</title>
</head>
<cfif isdefined("form.upload_now")>
<cffile action="upload" filefield="ul_path" destination="D:\Hosting\username\upload" accept="image/jpeg, image/gif" nameconflict="makeunique">
The file was successfully uploaded!
</cfif>

<form action="gd_upload.cfm" method="post" name="upload_form" enctype="multipart/form-data" id="upload_form">
<input type="file" name="ul_path" id="ul_path">
<input type="submit" name="upload_now" value="submit">
</form>
</body>
</html>

NOTE: For Linux hosting accounts, uploading files to your root directory is not supported. Also, for the "cffile" to function properly and for maximum security you should set the permissions of your upload folder to 703.

For more information on the cffile tag, please see Macromedia’s online documentation.

Domain Registration Domain Registration
Pay less for website domain names. Register your own .com, .net or .org for as low as $8.67/yr. A free Email Account is included.
Website Hosting Website Builder
For as little as $3.89 per month you can build your Website online with Website Builder using our easy to use professionally designed templates.
Play Video
Shopping Cart Software Quick Shopping Cart
Build and run your own successful online store in minutes! You're just five easy steps away!
Play Video
Website Hosting Website Hosting
Everything you need to give your Website the reliable, high-performance home it deserves!