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.