Upload | algorithm | No component A few days ago to help friends faintbear modify an "ASP no component Upload" code, got some experience, written here, perhaps a little useful.
I have not developed an ASP program, just temporary quote Buddha foot, modified the control statement, so, here no longer give the ASP code, just explain the idea. (You'd better read this article before you look at the faintbear "ASP no component Upload principle (Turn)" This article, repeat the part I no longer describe)
In general, a form form may post multiple texts in 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"/>
<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 the file1 can be very large, and such as IDs, name, friend, and so many domains to submit, and File1, ID, name, and friend's relative position is uncertain (in the original text is the order of these entries to die), how to better divide the flow of the block it?
My idea is: first by the entry to divide the block, is file1, ID, name, friend each piece, and then, if the file type, and then according to its size subdivided into several pieces. Basically this is the structure:
--------------------------
File1------------
No.1 block
------------
No.2 block
------------
No ..... Block
------------
--------------------------
Id
--------------------------
Name
--------------------------
Friend
--------------------------
This is orderly, both to ensure that the structure of the clear, but also to solve the problem of large file uploads.