ShotGraph例程
发表于:2007-06-30来源:作者:点击数:
标签:
下面是HTML文件用于上传3个文件 blockquote pHTML br BODY BGCOLOR=#FFFFFF br FORM METHOD=POST ENCTYPE=multipart/form-data ACTION=Upload.asp br INPUT TYPE=FILE NAME=FILE1BR br INPUT TYPE=FILE NAME=FILE2BR br INPUT TYPE=FILE NAME=FILE3BR br br I
下面是HTML文件用于上传3个文件
<blockquote>
<p><HTML> <br>
<BODY BGCOLOR="#FFFFFF"> <br>
<FORM METHOD="POST" ENCTYPE="multipart/form-data"
ACTION="Upload.asp"> <br>
<INPUT TYPE=FILE NAME="FILE1"><BR> <br>
<INPUT TYPE=FILE NAME="FILE2"><BR> <br>
<INPUT TYPE=FILE NAME="FILE3"><BR> <br>
<br>
<INPUT TYPE=TEXT NAME="DESCRIPTION"><BR> <br>
<br>
<SELECT NAME="CATEGORY" MULTIPLE><br>
<OPTION>Image<br>
<OPTION>Text<br>
<OPTION>Source Code<br>
<OPTION>Archive<br>
</SELECT><BR><br>
<br>
<INPUT TYPE=SUB
MIT VALUE="Upload!"> <br>
</FORM> <br>
</BODY> <br>
</HTML> <br>
</font></p>
</blockquote>
上传程序(Upload.asp):
< %
Set Upload = Server.CreateObject("Persits.Upload.1")
@# Upload files
Upload.OverwriteFiles = False @# Generate unique names
Upload.SetMaxSize 1048576 @# Truncate files above 1MB
Upload.Save "c:\upload"
@# Process all files received
For Each File in Upload.Files
@# Save in the database as blob
File.ToDatabase "DSN=data;UID=sa;PWD=zzz;", _
"insert into mytable(blob) values(?)"
@# Move to a different location
File.Copy "d:\archive\" & File.ExtractFileName
File.Delete
Next
@# Display description field
Response.Write Upload.Form("Description") & "
"
@# Display all selected categories
For Each Item in Upload.Form
If Item.Name = "Category" Then
Response.Write Item.Value & "
"
End If
Next
% >
原文转自:http://www.ltesting.net