Reputation: 176
I have 4 upload textboxes and one submit button I want to save 4 images into 4 folders depending on textbox sequence.
Problems I am facing are:
I get file using HttpPostedFileBase so I can't differentiate which file came from which text box.
Upvotes: 1
Views: 455
Reputation: 684
you can have 4 different input controls with 4 different names and in controller 4 different file bases ... and based on the control name you can save it to different folders
In your View
<input type="file" name="file1" />
<input type="file" name="file2" />
<input type="file" name="file3" />
<input type="file" name="file4" />
In your Controller
[HttpPost]
public ActionResult FileUpload(HttpPostedFileBase file1,HttpPostedFileBase file2,HttpPostedFileBase file3,HttpPostedFileBase file4)
{
}
Upvotes: 1