Following is my form
<form id="postProblemForm" action="/Problems/Post" method="post">
<input type="text" id="problemSubject" name="problemSubject" class="inp-form"/>
<input type="file" id="uploadFile" name="uploadFile"/>
<textarea rows="" cols="" class="form-textarea" id="problemDescription" name="problemDescription"></textarea>
</form>
I have to send this form to controller. Controller code is
[HttpPost]
public void Post(FormCollection form)
{
string subject = form["problemSubject"];
string description = form["problemDescription"];
HttpPostedFileBase photo = Request.Files["uploadFile"];
}
I can get "problemSubject" and "problemDescription" values easily. But don't know how to get uploaded image and save it at server side. I wanna save at "~/ProblemImages". Pls help.