Forum OpenACS Q&A: Not getting uploaded files

Collapse
Posted by Kolja Lehmann on
I have the problem that I don't get any files uploaded. If I want to upload a <input type=file name=myfile>, I do get the variable myfile set to the remnote file name, but [ns_queryget myfile.tmpfile] doesn't return the temp file name but just an empty string.
Is this an aolservcer problem or a configuration issue? anyone seen this before?
Collapse
Posted by Michael Hinds on
Do you have "enctype=multipart/form-data" in your form tag?
Collapse
Posted by Kolja Lehmann on
Thank you. That was it. I relied on ad_form, but obviously that doesn't add multipart/formdata.
Collapse
Posted by Jon Griffin on
Collapse
Posted by Kolja Lehmann on
But that doesn't set the enctype.
Would there be any harm if enctype=multipart/form-data would always automatically be included in the form tag of the form manager?
Collapse
Posted by Kolja Lehmann on
Ok, like this it works:
ad_form -name test -html {enctype multipart/form-data} -form {...}

Maybe you should add this to the ad_form docs.

Collapse
Posted by Jon Griffin on
Thanks, I added this to my docs.