We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Upload & email images with Freeform

Development and Programming

Friday creative's avatar
Friday creative
32 posts
16 years ago
Friday creative's avatar Friday creative

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

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
16 years ago
Mark Bowen's avatar Mark Bowen

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

       
Friday creative's avatar
Friday creative
32 posts
16 years ago
Friday creative's avatar Friday creative

Thanks Mark. I have the file_upload set to Main Upload Directory & send_attachment=”yes” but no dice! It seems the upload just isn’t happening?!

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
16 years ago
Mark Bowen's avatar Mark Bowen

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

       
Friday creative's avatar
Friday creative
32 posts
16 years ago
Friday creative's avatar Friday creative

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

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
16 years ago
Mark Bowen's avatar Mark Bowen

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" />

Documentation Link

Hopefully that should work for you then.

Best wishes,

Mark

       
Friday creative's avatar
Friday creative
32 posts
16 years ago
Friday creative's avatar Friday creative

Yep. Sorry - your way works perfectly….just wasn’t sure why? Thanks again.

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
16 years ago
Mark Bowen's avatar Mark Bowen
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

       
Friday creative's avatar
Friday creative
32 posts
16 years ago
Friday creative's avatar Friday creative

Obviously, I’d completely missed that! Thank you,

Matt

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
16 years ago
Mark Bowen's avatar Mark Bowen
Obviously, I’d completely missed that! Thank you, Matt

No problem 😉

Hope it all goes well for you.

Best wishes,

Mark

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.