ASP non-component upload with progress bar (cont.)

Source: Internet
Author: User
Tags file upload net server memory
Upload | no components

A few months ago, wrote about ASP no component upload with progress bar blog, at that time the main analysis of the Web file upload and in the background to obtain analysis of the implementation of the principle of data. The implementation of the progress bar is the fundamental to achieve the block to obtain data, according to the block size and number of blocks to record the uploaded size. There are some specific details that were not clearly stated at the time:

Q: How is progress information accessed?
A: Progress information is saved in application, and a progress ID is generated each time it is uploaded, and the current upload progress information in application can be retrieved based on this progress ID.

Q: What form is the progress information stored in the application?
A:asp is too weak, I tried scripting.dictionary and xmldom, but the ASP application can not save this object, if the asp.net can be directly used Hashtable. Finally, a Adodb.recordset object is used in application to save progress related information.

Q: How to ensure that the page can immediately respond to display progress bar information?
A:
To close session state with <% @enablesessionstate =false%> declaration at the beginning of the file
To ensure that caching is disabled:
Response.CacheControl = "No-cache"
Response.Expires =-1

Q: Can upload a large number of files?
A: This and the speed, server memory and other factors related to the server.scripttimeout set long enough, then theoretically can stay connected with the server for a long time. Because you cannot implement append writes to a file in ASP, you must store all the data that you want to write to in memory, so that if you upload a large file, it will take up server memory (a text file can append writes using Textstream.write). Under the asp.net is more cool, when the block reading, each read a piece of analysis, and then upload the data content "append" to the hard disk file, the memory footprint is very small. The general dozens of MB file is still no problem, too large upload is not very meaningful for the web.

Write a more complete example, you can download the use of:

Demo Downloads

Http://www.webuc.net/MyProject/upload/upload.rar



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.