I have an mvc3 project and I need to incorporate a file uploader dialog that handles multiple files. I also need to be able to check the file size of these files on/before upload.
I haven't use this funcitonality before and there appears to be a lot of stuff out there from SwfUploader to Ajax soltuions so I'm looking for some insight on the best solution regarding requirements (multiple files and file size checking).
Yes, there are many upload solutions based on different platforms (Flash, Java, Ajax). I would like to recommend you to try
Aurigma Image Uploader. I tried it. It has usable API and wide-range feutures allowing to get expected results (multiple uload of any files and checking file sizes).
per the file dialog...where select files...you can only select one file in the windows dialog. i need to be able to upload multiple files from the windows dialog (where you ctrl click files).
shayska
Member
116 Points
114 Posts
Multiple File Upload with file size checking
Mar 26, 2012 07:08 PM|LINK
I have an mvc3 project and I need to incorporate a file uploader dialog that handles multiple files. I also need to be able to check the file size of these files on/before upload.
I haven't use this funcitonality before and there appears to be a lot of stuff out there from SwfUploader to Ajax soltuions so I'm looking for some insight on the best solution regarding requirements (multiple files and file size checking).
Thanks!
kshyju
Member
134 Points
39 Posts
Re: Multiple File Upload with file size checking
Mar 26, 2012 07:26 PM|LINK
Have the form with multiple file upload controls<form action="" method="post" enctype="multipart/form-data">
<label for="file1">Filename:</label>
<input type="file" name="files" id="file1" />
<label for="file2">Filename:</label>
<input type="file" name="files" id="file2" />
<input type="submit" />
</form>
and in your controller, let the parameter of your action method be a n IEnumerable of HTTPPostedFileBase type.
[HttpPost]
public ActionResult Index(IEnumerable<HttpPostedFileBase> files) {
foreach (var file in files) {
if (file.ContentLength > 0) {
var fileName = Path.GetFileName(file.FileName);
var path = Path.Combine(Server.MapPath("~/App_Data/uploads"), fileName);
file.SaveAs(path);
}
}
return RedirectToAction("Index");
}
More information here. http://haacked.com/archive/2010/07/16/uploading-files-with-aspnetmvc.aspx
My flarack profile
shayska
Member
116 Points
114 Posts
Re: Multiple File Upload with file size checking
Mar 26, 2012 08:11 PM|LINK
Thanks for the response...but I need to upload multiple files from the dialog. Not multiple instances (file buttons).
Young Yang -...
All-Star
21344 Points
1818 Posts
Microsoft
Re: Multiple File Upload with file size checking
Mar 28, 2012 09:33 AM|LINK
Hi
Could you explain more? From dialog? What dialog?
Regards
Young Yang
Feedback to us
Develop and promote your apps in Windows Store
vachevski
Member
44 Points
13 Posts
Re: Multiple File Upload with file size checking
Apr 02, 2012 11:03 AM|LINK
Hi,
Yes, there are many upload solutions based on different platforms (Flash, Java, Ajax). I would like to recommend you to try Aurigma Image Uploader. I tried it. It has usable API and wide-range feutures allowing to get expected results (multiple uload of any files and checking file sizes).
shayska
Member
116 Points
114 Posts
Re: Multiple File Upload with file size checking
Apr 09, 2012 07:59 PM|LINK
per the file dialog...where select files...you can only select one file in the windows dialog. i need to be able to upload multiple files from the windows dialog (where you ctrl click files).