Upload - Files and forms with large/huge size. | ||
Article, Upload - Files and forms with large/huge size. | ||
Member of ScriptUtils.ASPForm |
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 = 40000There 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. Progress bar 5. Use low application protection (inprocess ASP) |
<httpRuntime maxRequestLength="8192" />
Other references |
---|
ScriptUtils.ASPForm.MaxMemoryStorage |