Research on large file uploading in asp.net application
Source: Internet
Author: User
Asp.net| upload in the project often use a large file upload, to upload the file has more than 100 m, so the study of the domestic use of large file upload components found in more than two controls Aspnetupload 2.0 and Lion.Web.UpLoadModule, two control methods are: using the implied httpworkerrequest, with its getpreloadedentitybody and The Readentitybody method reads data from the pipe that IIS creates for ASP.net. Chris Hynes provides us with a scheme (with HttpModule) that allows you to upload a large file, in real time, to show the upload progress.
Lion.Web.UpLoadModule and Aspnetupload two. NET components are used in this scenario.
When the flyer file, two software methods are the same, inherit HttpModule
HttpApplication Application1 = sender as HttpApplication;
HttpWorkerRequest request1 = (HttpWorkerRequest) ((IServiceProvider) httpcontext.current). GetService (typeof (HttpWorkerRequest));
Try
{
if (Application1. Context.Request.ContentType.IndexOf ("Multipart/form-data") <=-1)
{
Return
}
Check the Hasentitybody
if (!request1. Hasentitybody ())
{
Return
}
int NUM1 = 0;
TimeSpan span1 = DateTime.Now.Subtract (this.begintime);
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