本文介绍了上传大文件(1GB)-ASP.net的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要至少上传 1GB 文件大小的大文件。我使用 ASP.Net C# IIS 5.1 作为我的开发平台。

I need to upload large files of at least 1GB file size.I am using ASP.Net, C# and IIS 5.1 as my development platform.

我使用的:

HIF.PostedFile.InputStream.Read(fileBytes,0,HIF.PostedFile.ContentLength)

使用前:

File.WriteAllBytes(filePath, fileByteArray)

(犯规去这里,但给的System.OutOfMemoryException 除外)

目前我已经设置了的httpRuntime 来:

executionTimeout = 999999 的maxRequestLength = 2097151 (这就是2GB!)      useFullyQualifiedRedirectUrl =真minFreeThreads =8minLocalRequestFreeThreads =4      AP prequestQueueLimit =5000enableVersionHeader =真正的requestLengthDiskThreshold =8192

此外,我已设置 maxAllowedContentLength =** 2097151 **(猜它仅适用于IIS7)

Also i have set maxAllowedContentLength="**2097151**" (guess its only for IIS7)

我已经改变了 IIS 连接超时999,999秒了。

I have changed IIS connection timeout to 999,999 secs too.

我无法上传甚至 4578KB (Ajaz-Uploader.zip)

I am unable to upload files of even 4578KB (Ajaz-Uploader.zip)

推荐答案

我们有一个应用程序偶尔需要上传1和2 GB的文件,所以一直运行到这一点。经过反复研究,我的结论是,我们需要实现pviously提到的$ P $ NeatUpload 或类似的东西。

We have an app that occasionally needs to upload 1 and 2 GB files, so has been running into this as well. After much research, my conclusion is that we need to implement the previously mentioned NeatUpload, or something like it.

此外,要知道,

<requestLimits maxAllowedContentLength=.../>

是衡量字节,而

<httpRuntime maxRequestLength=.../>

是衡量千字节。所以,你的价值观应该看起来更像是这样的:

is measured in kilobytes. So your values should look more like this:

<httpRuntime maxRequestLength="2097151"/>
...
<requestLimits maxAllowedContentLength="2097151000"/>

这篇关于上传大文件(1GB)-ASP.net的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-23 17:53