asp.net mvc - how to upload multiple images with progress bar in asp .net mvc 4 with razor? -
i need upload selected multiple images @ time showing progress bar each in asp .net mvc 4 razor.please 1 help
this basic:
this example self-explanatory.. hope helps!
create form uploading multiple files:
<form action="" method="post" enctype="multipart/form-data"> <label for="lblfile1">filename:</label> <input type="file" name="files" id="file0" /> <label for="file2">filename:</label> <input type="file" name="files" id="file1" /> <input type="submit" value="upload"/> </form>
now in controller post action:
[httppost] public actionresult upload(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("upload"); }
edit:
i don't have time create sample project progress bar.. link you!
Comments
Post a Comment