Automatic video uploading in ASP.

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.