You may have to create additional downloads yourself. This can be done using jQuery, for example:
Here's the HTML:
<div id="uploads"> <div id="uploadtemplate"> <input type="file" name="upload" /> <input type="text" name="FileName" /> <div> <a href="#" id="addFile">Add file</a> </div>
At boot, we will clone the "template" in a variable for later use. When we click, we clone the template and add it to the document.
$(function() {/ $('#addFile').data('uploadtemplate', $('#uploadtemplate').attr('id', '').clone()); $('#addFile').click(function(e) { $(this).data('uploadtemplate').clone().insertBefore( $this) ); e.preventDefault(); }); });
Your model will be:
public class Foo { public string[] FileName { get; set; }
Then analyze Request.Files and do the magic that you know :-) The Foo.FileName field will contain the file name set by the user for each uploaded file. You can use this as the first file in Request.Files will be displayed in Foo.FileName [0], etc.
source share