{
context1.Items["__removeUploadStatus"] = uploadId;
}
return status1;
}
private HttpWorkerRequest GetWorkerRequest(HttpContext context)
{
return (HttpWorkerRequest) ((IServiceProvider) HttpContext.Current).GetService(typeof(HttpWorkerRequest));
}
private void InjectTextParts(HttpWorkerRequest request, byte[] textParts)
{
BindingFlags flags1 = BindingFlags.NonPublic | BindingFlags.Instance;
Type type1 = request.GetType();
while ((type1 != null) && (type1.FullName != "System.Web.Hosting.ISAPIWorkerRequest"))
{
type1 = type1.BaseType;
}
if (type1 != null)
{
type1.GetField("_contentAvailLength", flags1).SetValue(request, textParts.Length);
type1.GetField("_contentTotalLength", flags1).SetValue(request, textParts.Length);
type1.GetField("_preloadedContent", flags1).SetValue(request, textParts);
type1.GetField("_preloadedContentRead", flags1).SetValue(request, true);
}
}
private bool IsUploadRequest(HttpRequest request)
{
return request.ContentType.ToLower().StartsWith("multipart/form-data");
}
private void RegisterIn(HttpContext context, MimeUploadHandler handler)
{
context.Items["_uploadHandler"] = handler;
context.Application["_UploadStatus_" + handler.UploadStatus.UploadId] = handler.UploadStatus;
}
public static void RemoveFrom(HttpApplicationState application, string uploadId)
{
application.Remove("_UploadStatus_" + uploadId);
}
public static void RemoveFrom(string uploadId)
{
HttpUploadModule.RemoveFrom(HttpContext.Current.Application, uploadId);
}
private void SetUploadState(HttpContext context, UploadState state)
{
MimeUploadHandler handler1 = this.GetUploadHandler(context);
if (handler1 != null)
{
handler1.UploadStatus.SetState(state);
}
}
void IHttpModule.Dispose()
{
}
void IHttpModule.Init(HttpApplication context)
{
context.BeginRequest += new EventHandler(this.context_BeginRequest);
context.Error += new EventHandler(this.context_Error);
context.EndRequest += new EventHandler(this.context_EndRequest);
}
}
}








