ShotGraph例程

80酷酷网    80kuku.com

  下面是HTML文件用于上传3个文件

<blockquote>
  <p><HTML>

  <BODY BGCOLOR="#FFFFFF">

  <FORM METHOD="POST" ENCTYPE="multipart/form-data"
  ACTION="Upload.asp">

  <INPUT TYPE=FILE NAME="FILE1">


  <INPUT TYPE=FILE NAME="FILE2">


  <INPUT TYPE=FILE NAME="FILE3">


  

  <INPUT TYPE=TEXT NAME="DESCRIPTION">


  

  <SELECT NAME="CATEGORY" MULTIPLE>

  <OPTION>Image

  <OPTION>Text

  <OPTION>Source Code

  <OPTION>Archive

  </SELECT>


  

  <INPUT TYPE=SUBMIT VALUE="Upload!">

  </FORM>

  </BODY>

  </HTML>

  </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
% >

分享到
  • 微信分享
  • 新浪微博
  • QQ好友
  • QQ空间
点击: