My Account   Contact Us    
  
» HomeProductsSupportDeveloper CommunityCompany
Upload File To Directory
Author: Kevin Lee
Category: ColdFusion
This code shows how to upload a file from a .cfm to any directory on your server.

<html>
<head>
<title>File Upload with ColdFusion</title>
</head>
<body>
<div align="center"><h2>PROJECT FILE SUBMISSION PAGE</h2> </div>
<br>
<br>
  Please Be Sure Your File Meets the Following Requirements <big>PRIOR</big> to
  Upload: <br>
  <br>
  1 - Filename must not exceed 8 letters in length <br>
  2 - Filename must be your first initial and last name (up to 7 letters) my file
  would look like this: klee.bas <br>
  3 - Include all comments in your program <br>
<menu>' Name: "Your Name"
<br> ' Date:  "Date of Submission"
<br> ' File:  "Name of file"
<br> ' Project:  "Name of Project"
<br> ' Purpose:  "Briefly describe the purpose of the program"</menu>


<br>
4 - Click the "Browse Button, then find the project file you wish to upload
<center>
<form action="cf_upload.cfm" method="post" name="upload_form" enctype="multipart/form-data" id="upload_form">
<input type="file" name="ul_path" id="ul_path">
</center>
<br>5 - Be sure "after" you click "Submit" you get a "Successful Upload" message just below this line!
<br><br>
<cfif isdefined("form.upload_now")>
<cffile action="upload" filefield="ul_path" destination= "Your Directory Path Here (for desired upload to be stored)" nameconflict="error">
<center></center><blink><font color="#CC0000" face="Geneva, Arial, Helvetica, sans-serif">The file was successfully uploaded!</font></blink> </center>
</cfif>
<br>
<input type="submit" name="upload_now" value="submit">
</form>

Have a problem uploading?  <a href="mailto:you@yourhost.com">Email Me</a>
</center>
</body>
</html> 



Content Management Powered by ActivEdit  ActivEdit Browser Based WYSIWYG HTML Editor

More Code Samples

Sign up for our newsletter: | Subscribe with RSS: RSS
© ActivSoftware 1999 to 2005 | Privacy Statement