6

I have a form that has a file field on it. I think I am missing something simple. The code for the form is as follows:

{exp:freeform:form form_name="product_support" required="customer_name|email" return="contact/thanks" notify_admin="yes" admin_notification_template="product_support" form:id="freeform" form:class="contact-form"}
<label for="support-logs">Upload error logs as a zip file</label>
<input type="file" id="support-logs" name="file1">
<button type="submit" class="submit bordered blue arrow">Submit</button>{/exp:freeform:form}

The form submits and all of the values are stored but for whatever reason the file that was specified does not get saved. I have verified that in FreeForm 4.0.10 the field exists, is assigned to the proper form and has file upload as it's type. I also verified that the location on the server exists and is set to 777.

There seemed to be more parameters with FreeForm 3.x so I was looking for those in the documents but did not see them. Perhaps I am missing things like file_upload/allowed_file_types and the like? Or maybe the CP settings have taken over this functionality.

Thoughts?

ANSWER: Since StackExchange won't allow me to answer my question yet I'll edit here to give the answer.

Changed the input field for the file upload to a FreeForm field like so:

{freeform:field:file1 show="1"}

Works like a charm now.

Thanks!

  • +1 so you will have enough rep to post answers straight away in future :) – Adrian Macneil Feb 28 '13 at 14:56
  • Thanks for the answer. I had an old template that wasn't using the freeform field tags, this fixed it. – dorothy Dorothy Jan 23 '15 at 9:51
  • How do I get a pic of me.teying to download it but it was not a good picture – Valorle Haynes Apr 14 at 0:05
2

This is happening since we moved file fields to custom fields in Freeform 4 enctype="multipart/form-data" doesn't get added automatically to the element opener.

If you want to do file fields manually you can use the param form:enctype="multipart/form-data" which will add the param to the opening element.

| improve this answer | |
1

Since StackExchange won't allow me to answer my question yet I'll edit here to give the answer.

Changed the input field for the file upload to a FreeForm field like so:

{freeform:field:file1 show="1"}

Works like a charm now.

Thanks!

| improve this answer | |
0

Can you add a parameter like?

enctype="multipart/form-data"
| improve this answer | |
  • Nevermind. According to Solspace forums: "The enctype=”” parameter doesn’t exist in Freeform. Freeform should take care of outputting this form parameter automatically for you" – Zachary Feb 27 '13 at 21:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.