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!

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

3 Answers 3

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.

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!

0

Can you add a parameter like?

enctype="multipart/form-data"
1
  • 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" Commented Feb 27, 2013 at 21:29

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.