-2

我正在尝试使用上传处理程序上传视频,但在上传大型视频文件时system.outofmemoryexception抛出。我的代码在下面

using System.Collections.Generic;
using System;
using System.Drawing;
using System.Web;
using System.IO;
using SageFrame.Web;
using System.Web.SessionState;
using System.Web.Configuration;

public class UploadHandler : IHttpHandler, IRequiresSessionState
{
    public void ProcessRequest(HttpContext context)
    {
        HttpRuntimeSection configSection = new HttpRuntimeSection();
        context.Response.Write(configSection.MaxRequestLength);  
        HttpRequest Request = HttpContext.Current.Request;
        HttpFileCollection myfile = Request.Files;  ////Here i get error     
    }
}

我正在使用VS2010谢谢。

4

1 回答 1

0

正如建议的那样,您可能需要更改 HttpRuntime maxRequestLength 属性以允许您的大文件大小。指定的大小以千字节为单位,下面的示例将其设置为 100MB:

<httpRuntime maxRequestLength="102400"/>
于 2012-08-01T10:46:59.307 回答