Upload multile files dynamically using MVC4
could you please tell me how to upload multiple documents and store in database dynamically using mvc4
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
anil babuPosted Jan 29, 2014, 8:38 AM
Select must 10 images***
CS Code:
This is working fine for aploading AND save to database That image urls to database,
Supose i want to i want to select 2mages only at the time of saving that image url's to database not working
Jaganathan BantheswaranPosted Oct 29, 2013, 3:27 AM
You can use file input element as shown below,
View:
Controller:
[HttpPost]
public ActionResult Upload()
{
var file = Request.Files[0];
if (file != null && file.ContentLength > 0)
{
var fileName = Path.GetFileName(file.FileName);
var path = Path.Combine(Server.MapPath("~/Images/"), fileName);
file.SaveAs(path);
}
return RedirectToAction("UploadDocument");
}
More details on uploading files, read articles,
- Uploading Multiple Files in ASP.NET 2.0: Part II
pload dynamically