by Arra Derderian
29. October 2011 22:52
We recently completed a module for uploading a file along with a standard form post. This was code based on the Contact module done by Contrib which we modified to send a file up to the server and drop it in the media folder. Before we accept the file we check for file type and size to make sure nothing malicious is sent up to the server.
Feel free to download the module from Orchard's gallery site : Cloud Construct Post File
The module is themed as a resume submission form so people can submit some information along with their resume. You can add the form as a widget or a complete page on your site. All of the submissions are available through a page in the admin dashboard that lets you view all of the resumes submitted to the site. Secondly, an email is sent out to the email address on file and the resume attached as well.

You can see above that you can easily access the upload file and all the information sent along with the form. There is also some jquery JavaScript code in the module that grabs the code's article header
$("#JobName").val($("article.career h3").html());
This captures the text in the article header and puts it in a hidden field on the page to also be submitted with the request. That way we can associate a job with a submission. I realize this is a little bit of a hack but until I can figure out the Global token piece of Orchard 1.3 or another way to access information about related modules I will need to keep this. Perhaps it was better suited as a Content Part that could be added to Content Type of Career.