<!--DATA TYPE="TypeLib" UUID="{B4E1B2DE-151B-11D2-926A-006008123235}"-->
Set Dir = Upload.Directory("c:\path\*.*", SORTBY_SIZE)
For Each Item in Dir
...
Next
-------------------------------------------
Expires As Date (Read-Only)
如果已经注册,返回9/9/9999,否则返回失效期。
用法:
Response.Write Upload.Expires
-------------------------------------------
Files As Object (Read-Only)
返回一个集合,这个集合包含有上传文件的引用。
使用这个集合之前,必须调用Save或 SaveVirtual方法。
要引用一个单个文件,可以使用从1开始的整数下标,或者相应的文件框的名称。
要列举集合里的项目,可以使用For/Each 语句。
用法:
Set File = Upload.Files(1)
Set File = Upload.Files("FILE1")
For Each File in Upload.Files
...
Next
-------------------------------------------
Form As Object (Read-Only)
返回一个集合,这个集合包括所有不是文件框的表单项目的引用。
使用这个集合之前,必须调用Save或 SaveVirtual方法。
要引用一个单个表单项目,可以使用从1开始的整数下标,或者相应的项目的名称。
要列举集合里的项目,可以使用For/Each 语句。
用法:
Name = Upload.Form(1)
Name = Upload.Form("Name")
For Each Item in Upload.Form
Response.Write Item.
Next
-------------------------------------------
IgnoreNoPost As Boolean (Read/Write)
当Upload.Save方法被脚本直接调用,而不是通过表单提交时,可以避免 "Wrong Content-Type"这个错误。当表单和相应的上传脚本在同一个文件时,这个属性很有用。
Upload.PreserveFileTime = False
-------------------------------------------
ProgressID As String (Read/Write)
上传进度条所用的,用来区分上传进程。
用法:
Upload.ProgressID = Request.QueryString("PID")
-------------------------------------------
RegKey As String (Read/Write)
指定注册码,如果没有指定,AspUpload会从系统注册表读取。
用法:
Upload.RegKey = "12345-67890-12345"
-------------------------------------------
TotalBytes As Long (Read-Only)
返回上传的总字节数。
只能在成功调用Save(SaveVirtual)方法后调用这个属性。
用法:
Response.Write Upload.TotalBytes
-------------------------------------------
TotalSeconds As Long (Read-Only)
返回上传持续的总时间。
只能在成功调用Save(SaveVirtual)方法后调用这个属性。
用法:
Response.Write Upload.TotalSeconds
-------------------------------------------
Version As String (Read-Only)
返回组件的版数,如:"3.0.0.0".
用法:
Response.Write Upload.Version
-------------------------------------------
UploadManager Methods
======================================================
Sub CopyFile (FromPath As String, ToPath As String, Optional Overwrite)
复制文件。
Overwrite 默认为True。如果设置为False,当目标路径存在时,这个方法会失败。
用法:
Upload.CopyFile "c:\path1\file.ext", "c:\path2\file.ext"
-------------------------------------------
Sub CreateDirectory (Path As String, Optional IgnoreAlreadyExists)
建立目录。
IgnoreAlreadyExists 默认为False。如果设置为True,当目标路径存在时,这个方法不会报错。
用法:
Upload.CreateDirectory "c:\dir1\dir2", True
-------------------------------------------
Sub CreateFile (Path As String)
建立一个空文件。
用法:
Upload.CreateFile "c:\path\file.txt"
-------------------------------------------
Sub DecryptAndSendBinary (Path As String, IncludeContentType As Boolean, ContentType As String, Key As CryptoKey, RemoveExt As Boolean, Optional Attachment, Optional FileName)
-------------------------------------------
Sub DeleteFile (Path As String)
删除文件。
用法:
Upload.DeleteFile "c:\path\file.txt"
-------------------------------------------
FileExists (Path As String) As Boolean
检测文件是否存在。
用法:
if Upload.FileExists("c:\path\file.txt") Then ...
-------------------------------------------
Sub FromDatabase (Connect As String, SQL As String, Path As String)
使用ODBC,从数据库的表中输出BLOB字段到硬盘。
Connect 指定ODBC连接字符串。
SQL 该SQL语句应该返回一条记录,这个记录应该包括Blob字段。
Path 完整的文件路径,包括文件名。
用法:
Upload.FromDatabase "DSN=mydb;UID=sa;PWD=xxx;", "select image_blob from myimages where id = 3", "c:\path\file.txt"
-------------------------------------------
Sub FromRecordset (Recorset As Variant, Path As String) 使用ADO Recordset 对象从数据库的表中输出BLOB字段。
Recordset 是一个recordset字段,比如rs("image_blob").。
Path 完整的路径,包括文件名。
用法:
Set rs = Server.CreateObject("adodb.recordset")
rs.Open "MYIMAGES", Connect, 2, 3
Upload.FromRecordset rs("image_blob")., "c:\path\file.txt"
-------------------------------------------
Sub LOGOnUser (Domain As String, Username As Str