ASP no component file upload, the key to efficiency

Source: Internet
Author: User
Upload | No component two days ago wrote the server-side download files to the client example, a friend sent a message to say want to discuss the efficiency of uploading files. Here is a personal point of view, friends can use msn:johntan2212@hotmail.com
or visit http://www.szchip.com to get in touch with me. Thank you

Using Formsize=request.totalbytes
Formdata=request.binaryread (Formsize)
Get the contents of the file if you are anxious to get the character form of the file while using St=f_bin2str (Formdata)
Then the St file processing, the efficiency is very low. Analysis of some foreign business components, they are used while reading the file side of the processing method, so the processing efficiency is very high. Mostly in the loop
While Startline<stsize
Wend
, the binary row is extracted first, and then the character is converted and processed.
LINELENGTH=INSTRB (STARTLINE,FORMDATA,CLSTR)-startline
LINESTRB=MIDB (Formdata,startline,linelength)
The changes are small, but the efficiency is doubled.
Do the experiment, the same file, read the load processing speed. It took 15 minutes, while the edge-reading process took only a few seconds.
The efficiency difference is also apparent.
This only means that I think of the method, if the shrimp have a better way, welcome to enlighten.



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.