Limits on the size of the binaryread file of ADODB. Stream in ASP

Source: Internet
Author: User

Upload a file in ASP. If the file size exceeds kb, request. binaryread does have a size limit, which can be found in c: \ windows \ system32 \ inetsrv \ metabase. the xml configuration file contains the following fields (my system is 2003): aspmaxrequestentityallowed = "204800"
Here we can see that file upload is restricted. If you want to implement the file request. binaryread (request. totalbytes), it is definitely not feasible. Therefore, you must use the multipart read method.

For example:

Readedbytes = 0
Chunkbytes = 1024*100 '100k multipart upload Scheme

Do While readedbytes <request. totalbytes
Oupfilestream. Write Request. binaryread (chunkbytes)
Readedbytes = readedbytes + chunkbytes
If readedbytes> request. totalbytes then readedbytes = request. totalbytes
Loop

If you use the above upload method, there is no file upload size limit. However, for large files, there is a file timeout phenomenon, so the server must have timed out.

# ASP Column

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.