AspUpload使用方法及属性详细介绍
时间:2010-08-29 来源:蔚蓝的大海
ASPUpload使用方法及属性详细介绍,CodePage As Long (Read/Write) ,可以把表单的文本项目名和文件名的字符从指定的CodePage转换为Unicode,比如表单是按UTF-8提交的,那么这个属性应该设置为65001。其他的如51 (Cyrillic), 1255 (Hebrew), 1256 (Arabic)等等。
用法:
< type=text/Java>attachEvent("", (){AutoSizeDIV(’CODE_7643’)}) 程序代码:
Upload.CodePage = 65001
-------------------------------------------
DetectMacBinary As Boolean (Read/Write)
默认为True。 这个属性用来控制是否检测上传的文件是MacBinary格式的,如果是则从中提取“data fork”。AspUpload 3.0 Beta 1. 不支持。
用法:
Upload.DetectMacBinary = False
--------------------------------------------
Directory (Path As String, Optional SortBy, Optional Ascending) As Object (Read-Only)
返回一个集合,这个集合包括指定目录的所有子目录和文件的引用。
在这个集合里,子目录总是优先于文件.Path 可以包括通配符 * 和 ?。
SortBy 可以是: SORTBY_NAME (1, default). SORTBY_TYPE (2), SORTBY_SIZE (3), SORTBY_CREATIONTIME (4), SORTBY_LASTWRITETIME (5), and SORTBY_LASTAccessTIME (6).
Ascending 默认为True。
用法:
<!--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.IgnoreNoPost = True
-------------------------------------------
OverwriteFiles As Boolean (Read/Write)
默认为True。如果设置为False,那么当文件名已经存在时,AspUpload会在原文件名后附加“(12)”这种形式的字符。这个属性影响Save, SaveVirtual 和 File.SaveAs方法。
用法:
Upload.OverwriteFiles = False
-------------------------------------------
PreserveFileTime As Boolean (Read/Write)
默认为Flase。如果设置为True,会试图保护上传文件的上次修改时间。
这个属性只是客户端使用XUpload或者JUpload 的时候有用。
当使用常规Form提交的时候,它没有任何作用。
用法:
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)
和SendBinary相同,但是发送之前会使用Key对文件进行编码,这个Key可以由AspEncrypt组件生成。
creative zen cablevideo card graphics card windows 7webcam software downloadbasic motorcycle ridingadaptateur sata vers usbdriver monitorparallel serial pinouthome theater connection centerbest 512mb video cardevga driver downloadnikon coolpix s550 macelectronic sets kidsbarcode generator cardmdp hdmi cablelow carb menus recipeseee pc laptoplaser jet cartridge1000m media convertermlg vga vs hdmicomcast modem driverpci 66mhzati tv wonder hdtv tunercompare pcmcia flash cardnetwork enabled usb hubdigital camera reviewaudio signal boosterbest place to buy a homebenefits omega 3 fatty acidshv electrician jobsfile upload calculatorphoto printer inkjetkeyboard cablesrealtek updatesrgb input wikibutton travel wheel mousepen usbconnecting ps2 wireless internettruing dirt bike wheelbelkin router issuebelkin f5d8235 4 wireless n+ routerdual digital tuner card3.5 mini jack plugsvitamin b12 benefitshdmi cable walmart pricetranscend usb pen drivevirtual drums gamenvidia 5200 dual monitorcredit card holderwii turn basedpc repair game Replica lv Hangbags Replica Hangbags Hangbags replica handbags replica handbags replica handbags replica handbags usb cable usb cable usb cable usb cable
用法:
< type=text/Java>attachEvent("", (){AutoSizeDIV(’CODE_7643’)}) 程序代码:
Upload.CodePage = 65001
-------------------------------------------
DetectMacBinary As Boolean (Read/Write)
默认为True。 这个属性用来控制是否检测上传的文件是MacBinary格式的,如果是则从中提取“data fork”。AspUpload 3.0 Beta 1. 不支持。
用法:
Upload.DetectMacBinary = False
--------------------------------------------
Directory (Path As String, Optional SortBy, Optional Ascending) As Object (Read-Only)
返回一个集合,这个集合包括指定目录的所有子目录和文件的引用。
在这个集合里,子目录总是优先于文件.Path 可以包括通配符 * 和 ?。
SortBy 可以是: SORTBY_NAME (1, default). SORTBY_TYPE (2), SORTBY_SIZE (3), SORTBY_CREATIONTIME (4), SORTBY_LASTWRITETIME (5), and SORTBY_LASTAccessTIME (6).
Ascending 默认为True。
用法:
<!--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.IgnoreNoPost = True
-------------------------------------------
OverwriteFiles As Boolean (Read/Write)
默认为True。如果设置为False,那么当文件名已经存在时,AspUpload会在原文件名后附加“(12)”这种形式的字符。这个属性影响Save, SaveVirtual 和 File.SaveAs方法。
用法:
Upload.OverwriteFiles = False
-------------------------------------------
PreserveFileTime As Boolean (Read/Write)
默认为Flase。如果设置为True,会试图保护上传文件的上次修改时间。
这个属性只是客户端使用XUpload或者JUpload 的时候有用。
当使用常规Form提交的时候,它没有任何作用。
用法:
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)
和SendBinary相同,但是发送之前会使用Key对文件进行编码,这个Key可以由AspEncrypt组件生成。
creative zen cablevideo card graphics card windows 7webcam software downloadbasic motorcycle ridingadaptateur sata vers usbdriver monitorparallel serial pinouthome theater connection centerbest 512mb video cardevga driver downloadnikon coolpix s550 macelectronic sets kidsbarcode generator cardmdp hdmi cablelow carb menus recipeseee pc laptoplaser jet cartridge1000m media convertermlg vga vs hdmicomcast modem driverpci 66mhzati tv wonder hdtv tunercompare pcmcia flash cardnetwork enabled usb hubdigital camera reviewaudio signal boosterbest place to buy a homebenefits omega 3 fatty acidshv electrician jobsfile upload calculatorphoto printer inkjetkeyboard cablesrealtek updatesrgb input wikibutton travel wheel mousepen usbconnecting ps2 wireless internettruing dirt bike wheelbelkin router issuebelkin f5d8235 4 wireless n+ routerdual digital tuner card3.5 mini jack plugsvitamin b12 benefitshdmi cable walmart pricetranscend usb pen drivevirtual drums gamenvidia 5200 dual monitorcredit card holderwii turn basedpc repair game Replica lv Hangbags Replica Hangbags Hangbags replica handbags replica handbags replica handbags replica handbags usb cable usb cable usb cable usb cable
相关阅读 更多 +