Upload | sample | No component | Chinese file: uploadtest.asp
<title>untitled document</title>
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<body bgcolor= "#FFFFFF" >
<form method= "Post" Name= "Form1" enctype= "Multipart/form-data" action= "showdata.asp" >
<P>TEXT1:
<input type= "text" name= "Text1" >
</p>
<P>TEXT2:
<input type= "text" name= "Text2" >
</p>
<p>txtarea:
<textarea name= "TextField" cols= "rows=" ></textarea>
</p>
<p>file:
<input type= "File" name= "NewFile" >
</p>
<p>
<input type= "Submit" name= "submit" value= "Submit" >
<input type= "reset" name= "reset" value= "reset" >
</p>
</form>
</body>
File: showdata.asp
<!--#INCLUDE file= "Upload.inc"-->
<%
' Fields ("xxx"). Name gets the names of xxx (form Object) in form
' Fields ("xxx"). FilePath if it is the file Object that gets the full path
' Fields ("xxx"). FileName gets file name if it is file Object
' Fields ("xxx"). ContentType if it is file Object to get the type
' Fields ("xxx"). Length gets the data lengths of xxx (Form Object) in form
' Fields ("xxx"). Value gets the data content of xxx (form Object) in form
Dim formdata,formsize
Formsize=request.totalbytes
Formdata=request.binaryread (Formsize)
Set Fields = getupload (FormData)
Response.Write "Text1:" & Fields ("Text1"). Value & "<br>" & VbCrLf
Response.Write "Text2:" & Fields ("Text2"). Value & "<br>" & VbCrLf
Response.Write "TEXTAREA:" & Fields ("TextField"). Value & "<br>" & VbCrLf
Response.Write Fields ("NewFile"). FileName
Response.Write Fields ("NewFile"). ContentType
Response.ContentType = Fields ("NewFile"). ContentType
If Fields ("NewFile"). Filename<> "" Then
Response.ContentType = Fields ("NewFile"). ContentType
Response.BinaryWrite Fields ("NewFile"). Value
End If
' Response.BinaryWrite FormData
%>