Improvement of the "ASP no-component upload" Algorithm

Source: Internet
Author: User
A few days ago, I helped my friend faintbear modify an "ASP no-component upload" code. I had a few tips. It may be helpful to write it here.

I have not developed any ASP program, but I have temporarily reported my topic and modified the control statement. So I will not provide any ASP code here, just to explain my ideas. (Before reading this article, you 'd better read faintbear's ASP principle of component-less upload (). I will not describe the repeated parts)

In general, multiple texts may be post in a form, which is a simple example:
<Form method = "Post" Action = "Upload. asp" enctype = "multipart/form-Data">
<Label>
<Input type = "file" name = "file1"/>
</Label>
<Br/>
<Input type = "text" name = "ID" value = "234523894" type = "codeph" text = "codeph"/>
<Br/>
<Input type = "text" name = "name" value = "Faint bear"/>
<Br/>
<Input type = "text" name = "friend" value = "smile once"/>
<Br/>
<Input type = "Submit" value = "Submit"/>
<Input type = "reset" value = "reset"/>
</Form>

----------------------------- 7d429871607fe
Content-Disposition: Form-data; name = "file1"; filename = "G:/homepage.txt"
Content-Type: text/plain
Baoyu: http://www.webuc.net
----------------------------- 7d429871607fe
Content-Disposition: Form-data; name = "ID"
234523894
----------------------------- 7d429871607fe --
Content-Disposition: Form-data; name = "name"
Faint bear
----------------------------- 7d429871607fe --
Content-Disposition: Form-data; name = "friend"
Smile once
----------------------------- 7d429871607fe --

Because file1 may be very large, and there are many fields to be submitted, such as ID, name, and friend, in addition, the relative positions of file1, ID, name, and friend are uncertain (these entries are written to the dead order in the original article). How can we better divide the stream blocks?

My idea is: first, divide blocks by entries, that is, each block of file1, ID, name, and friend. Then, if it is file type, it is subdivided into several blocks based on its size. Basically, the structure is as follows:
--------------------------
File1 ------------
No.1 Block
------------
No. 2 Block
------------
No ...... Block
------------
--------------------------
ID
--------------------------
Name
--------------------------
Friend
--------------------------

This ensures a clear structure and solves the problem of uploading large files.

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.