Hi there,
I'm getting a strange error with a simple file upload and I
can't figure it out for the life of me. It's odd, because old code
I have written before has worked fine in this area, and I really
honestly can't see where I am going wrong.
First the error:
The form field arguments.image did not contain a file.
The error occurred in
C:\ColdFusion8\wwwroot\red_roof_rentals\components\query.cfc: line
37
35 :
36 : <!---<cftry>--->
37 : <cffile action="upload"
accept="image/jpg,image/jpeg,image/gif" filefield="arguments.image"
nameconflict="overwrite"
destination="#getDirectoryFromPath(getBaseTemplatePath())#\properties\">
38 : <cfset variables.image = "#file.ServerFile#" />
39 : <cfset variables.thumb = "thumb_#file.ServerFile#"
/>
I have researched this and found other people have had the
same problem - although please be aware that I do not beleive this
to be an issue with whatever version of CF I am running. I have
still not found an answer.
I have one template with my form called
"admin_create_property.cfm". When the form posts it invokes a CFC
method that uploads the file and inserts stuff into the database.
However, it dies at the file upload part with that bizzarre error.
There are only two files working in this:
admin_create_property.cfm
query.cfc
I will write the code out for these so you can see. Please
see attached code. Please note that I have taken out as much
irrelevant code as possible (html, doctypes etc etc).
Any help with this would be greatly appreciated as I am
absolutley stumped to be quite honest. I've heard people say it
could be any of the following:
1 - Need to use enctype="multipart/form-data" - which I DO
2 - cffile filefield can't contain ## - which it DOESN'T
3 - Inut type must be file - which it clearly is.
Please please help, I feel stupid asking about this but I
need you guys more than ever!
Kind regards and thanks in advance,
Mikey.