Recently, people often ask this kind of question, so I will post it here, the content:
1. Database table structure (Access):
UserID:Text (user ID that saves the uploaded file)
FileContentType:Text (used to save the type of uploaded file, eg: "Application/msword", which is mainly used to enable users to download this file correctly)
FileContent:OLEObject (save file data)
2. HTML files
muploadfile.htm
<Formname="upload_file"enctype="multipart/form-data" action="muploadfile.asp"method=post>
<inputtype=hiddenname="UserID"value="abc">
<inputtype=hiddenname="FileUploadStart">'This is used to indicate the start of file data upload
Filetosend:
<INPUTTYPE="file"name="file_up"size="30"><br>
<INPUTTYPE="file"name="file_up"size="30"><br>
<inputtype=hiddenname="FileUploadEnd">' is used here to indicate the end of the file data
<inputtype=submitvalue=Submit>
</Form></P><P>
3. ASP Files
muploadfile.asp</P><P><%
Response.Expires=0
Functionbin2str(binstr)
Dimvarlen,clow,ccc,skipflag</P><P>skipflag=0
ccc=""
IfNotIsNull(binstr)Then
varlen=LenB(binstr)
Fori=1Tovarlen
Ifskipflag=0Then
clow=MidB(binstr,i,1)
IfAscB(clow)>127Then
ccc=ccc&Chr(AscW(MidB(binstr,i+1,1)&clow))
skipflag=1
Else
ccc=ccc&Chr(AscB(clow))
EndIf
Else
skipflag=0
EndIf