I am trying to add file uploading to my CFWheels + Railo application. But I keep getting this error message when trying to use <cffile action="upload">
:
Form field [asset[file]] doesn't exist or has no content
How do I fix this?
After a couple hours of beating my head against the wall, I realized that I didn't set enctype="multipart/form-data"
on the form tag.
Fortunately, this is a fairly simple fix using the CFWheels startFormTag()
form helper and its multipart
argument:
#startFormTag(route="assets", multipart=true)#
...
#endFormTag()#