Skip to main content
Inspiring
January 18, 2009
Question

Uploading Images

  • January 18, 2009
  • 2 replies
  • 366 views
I'm trying to upload an image to a directory and I get the following error message:
The form field C:\ColdFusion8\runtime\servers\coldfusion\SERVER-INF\temp\wwwroot-tmp\neotmp48592.tmp did not contain a file.
The error occurred in C:\ColdFusion8\wwwroot\local\eg\cfimage\uploadmulti.cfm: line 20
18 : destination="uploaded_images/"
19 : nameconflict="OVERWRITE"
20 : filefield="#image_name#">
21 :
22 :

Here's my code:
<cfform action="uploadmulti.cfm" enctype="multipart/form-data">
Upload an image:
<cfinput type="file" name="image_name" accept="gif,jpg,jpeg,bmp">
<br />
<!--- Height: <input type="Text" name="img_height"><br>
Width: <input type="Text" name="img_width"><br> --->
<input type="Submit" name="upload" value="Upload">
</cfform>

Any ideas why CF is interpreting the string as empty?

    This topic has been closed for replies.

    2 replies

    jenn1Author
    Inspiring
    January 18, 2009
    Thank you! That worked. I keep forgetting to remove the # signs.
    Inspiring
    January 18, 2009
    i am pretty sure it is because you have something like
    filefield="#image_name#" in your <cffile action="upload" ...> tag.

    remove the # from around the field name in there - you need to provide
    the name of the form field to <cffile> tag, NOT the field's value.

    Azadi Saryev
    Sabai-dee.com
    http://www.sabai-dee.com/