我有一个HttpModule,作为文件上传模块,在将.NET Framework升级到4.5之后,其工作方式发生了变化。在4.0框架中,ReadEntityBody方法会用256k填充数组,但是在升级后,它只返回16k。还有其他人遇到这个问题吗?
public void ProcessRequest(HttpContext context)
{
IServiceProvider provider = (IServiceProvider)context;
HttpWorkerRequest worker = (HttpWorkerRequest)provider.GetService(
typeof(HttpWorkerRequest));
byte[] data = new byte[256 * 1024];
int readData = worker.ReadEntityBody(data, data.Length);
// ......
}