我正在尝试使用上传处理程序上传视频,但在上传大型视频文件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
谢谢。
答案 0 :(得分:0)
根据建议,您可能需要更改HttpRuntime maxRequestLength属性以允许大文件大小。指定的大小以千字节为单位,下面的示例将其设置为100MB:
<httpRuntime maxRequestLength="102400"/>