Brief overview of work with very large files. ASPForm configuration and IIS setting for huge uploads or urlencoded forms with big fields.
| Main idea for big uploads |
|---|
|
Upload components (including ASPNet HTMLInputFile) usually use memory to store temporary upload data. It is a problem, if you are uploading very large files. Huge-ASP upload works with unique hi-performance technology, which lets you read upload source data in small data blocks (Request.BinaryRead) and store the data on temporary disk folder - this is automatic Huge-ASP upload work, of course. You can specify size of a source data block and maximum amount of memory to store data (to store small uploads in memory). For example, HTMLInputFile from ASPNet takes around 5MB of memory to upload 1MB file. You will need at least 500 MB of a free memory if you have 10 clients uploading one 10MB file with ASPNet HTMLInputFile upload control. Huge-ASP upload takes less than 1MB (one megabyte) of memory to do the same action (and 100MB disk size to store temporary data, of course). |
| Important points for huge uploads with Huge-ASP upload |
|---|
|
1. Server.ScriptTimeout and ScriptUtils.ASPForm.ReadTimeout property.
Huge-ASP upload has a great performance - it lets you really accept 2GB files in 200second on 100Mb/s Ethernet line. But you have to set ScriptTimeout value to have enough time to transfer data and some time more to process uploaded files on server-side. If you want to accept up to 1GB uploads from min. 256k leased lines, set at least:
Server.ScriptTimeout = 40000 There
is no problem to set a big value for ScriptTimeout - Huge-ASP upload
checks client connection during upload and server-side upload process is
stopped when client interrupts
upload.You can also change this value by some dynamic algorithm with parameter of source form size. For example, on 10Mb/s Ethernet line (real 8000kb/s, 1MB/s): Dim ScriptTimeout, TotalBytes2. ScriptUtils.ASPForm.SizeLimit Size limit Second important value is a ScriptUtils.ASPForm.SizeLimit property. Huge-ASP upload has no limit set by default. It means you can upload and accept any files up to 2GB of size (2^31-1B; Huge-ASP upload can accept up to 4GB, but you will probably not have a client which let's you upload files bigger than 2GB ...). Internet Explorer (from v 5.0) and Netscape Navigator let's you upload files with size up to 2GB also. Be careful to have this value without limit - upload scripts are possible point for DOS attacks. If you have public upload script, set lower value rather. You can also create some dynamic algorithm to limit upload size based on logged on users, local IP addresses, etc. Form.SizeLimit = GetLimitFromDB(LOGON_USER)Please see ScriptUtils.ASPForm.Upload - Monitor and handle upload state/result article to handle "upload size exceeds the limit" state. 3. ScriptUtils.ASPForm.TempPath Temporary
path 4. IIS 6 and
AspMaxRequestEntityAllowed See also: 5. IIS 7 and
maxAllowedContentLength See also: 6. URLScan and other security utilities URLScan has its own limit for POST data. The value name is MaxAllowedContentLength and it is located in WINDOWS\system32\inetsrv\urlscan\urlscan.ini, default value is 30000000 (30MB). You shlould increase the value to process large uploads if you have URLScan on your site. See also MaxAllowedContentLength urlscan. 7. Progress
bar
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<httpRuntime maxRequestLength="8192" />
| Other references |
|---|
|
ScriptUtils.ASPForm.MaxMemoryStorage |
© 1996 - 2009 Antonin Foller, Motobit Software | About, Contacts | e-mail: info@pstruh.cz