Click here to Skip to main content
15,891,033 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I want to upload file in asp.net-mvc And AngularJS. How can I upload the file using html input file control?


What I have tried:

@using (Html.BeginForm("Index", "Home", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
    <input type="file" name="file" />
    <input type="submit" value="OK" />
}
Posted
Updated 19-Jul-17 0:03am
Comments
F-ES Sitecore 19-Jul-17 6:08am    
Google "upload file mvc" or "upload file angularjs" and you'll find lots of examples.

1 solution

@using(Html.BeginForm("UploadFile","Upload", FormMethod.Post, new { enctype="multipart/form-data"}))  
{  
      
    <div>  
        @Html.TextBox("file", "", new {  type= "file"}) <br />  
   
        <input type="submit" value="Upload" />  
   
    </div>  
      
      
}  
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900