Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Stephen Davidson 216 posts 392 karma points
    Oct 16, 2013 @ 11:34
    Stephen Davidson
    0

    Is it possible to add a File upload field to the contact form and have the file that gets uploaded attached to the email thats sent or even stored in the Umbraco back end somewhere?

    Regards,

    S

  • Sebastiaan Janssen 5045 posts 15476 karma points MVP admin hq
    Oct 16, 2013 @ 12:03
    Sebastiaan Janssen
    1

    Yes it's possible but I currently have no time to explain in full. Use <input type="file" multiple /> and handle the uploaded file(s) something like this:

            //For each file posted, create a new Image in the media section
            for (int i = 0; i < Request.Files.Count; i++)
            {
                HttpPostedFile file = Request.Files[i];
                if (file.ContentLength > 0)
                {
                   //Do something with the file
                }
            }
    

    I would strongly recommend you use Contour as that is all built in already and super easy to set up, this package is already a pretty big hack and pretty difficult to extend.

  • Stephen Davidson 216 posts 392 karma points
    Oct 16, 2013 @ 12:34
    Stephen Davidson
    0

    Thanks for the feedback. I would go for Contour but I can't justify the 120 Euros’ to the client just so he can allow people to add documents to the basic contact form on his site. Maybe if there is scope to fully utilise contour in the future...

    Regards,

    S

Please Sign in or register to post replies

Write your reply to:

Draft