Upload a File using CFFILE

Posted on 2000-04-18
Last Modified: 2013-12-24
I want to be able to upload a file that the user chooses.  This is the code I have used:

<CFFORM action="added.cfm" method="post" name="Archive">
<input type="file" name="path">

<CFFILE action="upload" filefield="path" destination="C:\Inetpub\wwwroot\CFDOCS\Project2\files\" nameconflict="overwrite">

<input type="submit" value="Archive File">

All on the same page.  However, I get the error:

Error Occurred While Processing Request
Error Diagnostic Information
The form field specified in the CFILE tag(PTAH) does not contain an uploaded file.  Please be sure that you have specified the correct field name.
The erroro occured while processing an element with a general identifier of (CFFILE), occupying the document position (91:7) ti (91:128).

What am I doing wrong?

PS I am willing to change the point value, it just seems as though this should be a really easy question.

Abram Weas
Schlumberger Acquisitions Systems Intern

Question by:RobotMan
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4

Expert Comment

ID: 2728243
Your CFFILE needs to be on the action page..(added.cfm)

That's where the FORM variable containing the uploaded file is can't do it all on the same page because the form doesn't get submitted until they press the submit button..

Also, I checked some code that I am using and I have ENCTYPE="multipart/form-data" specified in the CFFORM tag..not sure if that's necessary or not.  I can post an example for you if that doesn't work out..

Accepted Solution

nathans earned 30 total points
ID: 2728844
Here is a way to do it...
you need two files.
File 1


<form action="uploadfile.cfm" enctype="multipart/form-data" method="post">
File to Upload: <input name="FileName" size="50" type="file"><br>
<input type="submit" value="Upload the File"


<!-- This File was created by Nathan Stanford 1999 -->
File 2

      <title>File 2</title>

 action="upload" nameconflict="overwrite" filefield="FileName">
File Uploaded!<br><br>

<br><br>Upload More?<br>
<form action="uploadfile.cfm"  enctype="multipart/form-data" method="post">
File to Upload: <input name="FileName" size="50" type="file"><br>
<input type="submit" value="Upload the File"


Author Comment

ID: 2728954
I am going to try the example.  Thanx for the help guys.
Flexible connectivity for any environment

The KE6900 series can extend and deploy computers with high definition displays across multiple stations in a variety of applications that suit any environment. Expand computer use to stations across multiple rooms with dynamic access.


Author Comment

ID: 2732337
Adjusted points from 15 to 30

Author Comment

ID: 2732338
Thanx Nathans...
  (One of the smartest people I know is named Nathan -- maybe that is just a theme)
  I got the code to work perfectly.  I may have more questions later concerning this, but you really helped me leap this hurdle.

Author Comment

ID: 2732342
This was just what I needed...

Thank you for helping me out.
I am new to this points thing -- I hope that you got enough.

Featured Post

Don't Miss ATEN at InfoComm 2017!

Visit booth #2167 to see the  new ATEN VM3200 32 x 32 Modular Matrix Switch. Other highlights include the VE8950 4K HDMI Over IP Extender, VS1912 12-Port DP Video Wall Media Player  and VK2100 ATEN Control System. Register now with Free Pass Code ATEN288!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This is a guide to setting up a new WHM/cPanel Server to be used for web hosting accounts. It is intended for web hosting company administrators and dedicated server owners. For under $99 per month (considering normal rate of Big Data Cetnters like …
Have you ever sent email via ColdFusion and thought of tracking this mail to capture the exact date and time when the message was opened ?  If yes, then this article is for you ! First we need a table user_email with columns user_id , email , sub…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…
Suggested Courses

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question