Railo: Form field [asset[file]] doesn't exist or has no content

671 views Asked by At

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?

1

There are 1 answers

0
Chris Peters On BEST ANSWER

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()#