upload multiple files using MVC 4

I am trying to upload multiple files using MVC4. But I am not sure how to go about it. This is what I have till now.
Just including the main code. I referred to this from SO.
http://stackoverflow.com/questions/11235206/twitter-bootstrap-form-file-element-upload-button

In view
---------------
<div>
<span class="btn btn-primary btn-file">Browse...<input type="file" id="Upload" name="fileList" multiple/></span>
</div>

jquery script

$j('#upload').change(function(e){
var file=this.value;
var existingfiles = $j('#fileName').text();

if(!$j.isEmptyObject(existingfiles)){

 $j('#fileName').append("<br />" + file); 
}
else{
document.getElementById("fileName").textContent = file;
}
});

}

Open in new window



The script just displays the file name in adjacent div fileName.
I also have submit button at the end. The files get uploaded only on clicking submit button. so there will be no upload button.
How to go about that. Should I include above in html form ? How to perform the actual upload.
JyozealAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

MlandaTCommented:
I've been looking into this very same thing myself this week. These articles really helped us:

https://damienbod.wordpress.com/2014/03/28/web-api-file-upload-single-or-multiple-files/
http://hintdesk.com/android-upload-files-to-asp-net-web-api-service/

We're building mobile applications that need to submit documents via a REST API developed on ASP.NET Web API 2.0
0
louisfrCommented:
I suppose that the goal is for the user to be able to select files one after the other, instead of all at once (which is possible with the 'multiple' attribute).
The following script works by cloning the input field, because that's the only way to have the files content sent to the server.
    $('#upload').parent().on("change", "#upload", function (e) {
        var upload = $("#upload");
        upload.parent().append("<br/>", upload.val());
        upload.after(upload.clone());
        upload.attr("id", "u2");
        upload.hide();
    });

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Development

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.