in the video uploaded here for a long time, think of a lot of ways. Because what you want to do is to let the video start uploading automatically when you click on the icon, and the upload control file needs to click the Submit button before uploading.
<body> <div class= "container" > <div class= "Panel" > <div class= "Header" > <p> upload video </p> </div> <div class= "Panel-body" > <di V class= "Row-fluid" > <div class= "Picture" > </div> <div class=" Picture2 "> @* @using (Html.BeginForm ("Index", "UpLoad", FormMethod.Post, new {enctype = "multipart/form-data"}) {*@<form name= "Form1" action= "/upload" method = "POST" enctype = "Multipart/form-data" & Gt;<input type= "File" name= "file" id= "myfile" value= "" onchange = "uploadfile ();"/> @*< Input type= "Submit" name= "submit" id= "Submit"/>*@ </form> @*}*@</div> </div> <div class= " T "> upload video, that means you have agreed to <a href=" Declaration "><strong> campus video upload service terms </strong></a>, do not upload pornographic, reactionary and other illegal video </div>
effect (pending upload.) )
Controller in:
public Class Uploadcontroller:controller {//get:/upload/public actionresult Index () { return View (); } public ActionResult Declaration () {return View (); } [Acceptverbs (Httpverbs.post)] public actionresult Index (httppostedfilebase file, Uploadmodel model) {if (file. ContentLength > 0) {//Get save path string filePath = Path.Combine (httpcontext.serve R.mappath ("~/uploads"), Path.getfilename (file. FileName)); File. SaveAs (FilePath); Model.vedio = FilePath; Model. Id = Guid.NewGuid (); Model. id=request["text"]; UploadDB.UploadModel.AddVedio (model); } return View (); } }
The uploading of the video is complete, and the progress bar at the time of uploading is a difficult point. and continue to conquer. Automatic video uploading in ASP.