I’m currently building a site in EE and the client wants to have visitors fill out a simple form with a picture upload - where on submit, an email is sent to the administrator with the image attached. Is that feasible with Freeform?
I’ve got the form set up and it’s firing off the email but with no attachment….
Thanks in advance of any help
Matt
Hi Matt,
If you take a look at the file_upload=”“ and the send_attachment=”“ sorts of parameters then you should be able to do what you need on this.
Hope that helps a bit.
Best wishes,
Mark
This kind of code should work and give you a good basis to go on from :
{exp:freeform:form form_name="your_form" file_upload ="Main Upload Directory" notify="[email protected]" send_attachment="yes"}
Name
<input type="text" name="name" value="" />
Email
<input type="text" name="email" value="" />
Question
<textarea name="question" /></textarea>
<input type="file" name="file1" />
<input type="submit" name="submit" value="submit" />
{/exp:freeform:form}
Hope that helps a bit. A couple of things to make sure are that you have the file_upload=”“ parameter set to the correct name of one of your upload directories and that you have send_attachment=”yes” in the form too.
The code above does work as I just tested it out and I got the file it sent with no problems. Perhaps give that a go and see what you get.
Hope that helps a bit.
Best wishes,
Mark
Fantastic! Thanks Mark, I was about to jam a cinema display into my eye!
For the record - I still can’t see what’s wrong with my code
{exp:freeform:form form_name="gallery_uploader" required="name|email" notify="[email protected]" file_upload ="gallery_uploads" send_attachment="yes" template="default_template"}
<label for="name">NAME</label>
<input type="text" id="name" name="name" tabindex="1" />
<label for="email">EMAIL</label>
<input type="text" id="email" name="email" tabindex="2" /></p>
<label for="upload">UPLOAD YOUR FILE</label>
<input type="file" id="upload" name="upload" tabindex="3" />
<input type="submit" name="submit" value="Upload File" />
{/exp:freeform:form}
Baffling?!
Thanks again Mark, much appreciated.
Matt
Two things :
1 - You definitely have an upload destination with that exact name? 2 - Most importantly I don’t think your code is correct on the file upload field, try the same as I had above :
<input type="file" name="file1" />
Hopefully that should work for you then.
Best wishes,
Mark
Yep. Sorry - your way works perfectly….just wasn’t sure why? Thanks again.
There’s a documentation link in my last post which explains why they need to be that way 😉
Glad it’s all working for you now though.
Hope it all goes well for you.
Best wishes,
Mark
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.