设为首页
加入收藏
帮助中心
首页 | 红盾通告 | 信息中心 | ASP技术 | 数据库 | 网页设计 | 网管专栏 | OICQ攻略 | 墨客频道 | 网站运营 |
当前位置:首页 >> ASP技术 >> ASP应用 >> 正文
最新信息
·asp无限级分类加js收缩伸展…
·ASP读取EXCEL数据
·ASP编程操作Excel
·ASP编写了一个EXCEL上传程…
·ASP如何读取EXCEL工作表名…
·ASPJpeg和ASPUpload组件的…
·用ASP和SQL语句动态的创建…
·asp生成excel报表
·四大 FCKeditor 实战应用技…
·FCKeditor 2.0 的设置.修改…
资料搜索
热点信息
·asp生成excel报表
·Javascript+ASP制作树形菜…
·AspUpload组件的UploadedF…
·ASPJpeg和ASPUpload组件的…
·FckEditor中文配置手册详细…
·ASPUpload组件介绍
·金光ASP柱形图程序
·asp生成不重复的随机数字
·ASP读取EXCEL数据
·0-29内取15个不同的随机数…
推荐信息
·用ASP生成二维饼图
·一个取图片尺寸的类,支持…
·随即文件名
·ASP 随机图片
·本地图片,音乐等ASP防盗代…
·ASPJpeg和ASPUpload组件的…
·如何实现网上考试?
·用ASP打开远端MDB文件的方…
·ASP编写完整的一个IP所在地…
·用ASP实现远程批量文件改名


Google
 
AspUpload组件的UploadedFile
〖编辑:Cloudy | 浏览:人次〗

Attributes As Long (Read/Write)
Sets and returns this file's system attributes. Can be a combination of file attribute values defined in AspUpload type library:
FILE_ATTR_READONLY = &H1
FILE_ATTR_HIDDEN = &H2
FILE_ATTR_SYSTEM = &H4
FILE_ATTR_DIRECTORY = &H10
FILE_ATTR_ARCHIVE = &H20
FILE_ATTR_NORMAL = &H80
FILE_ATTR_TEMPORARY = &H100
FILE_ATTR_COMPRESSED = &H800


Usage:

<!--METADATA TYPE="TypeLib" UUID="{B4E1B2DE-151B-11D2-926A-006008123235}"-->
Response.Write File.Attributes

File.Attributes = File.Attributes + FILE_ATTR_READONLY

Relevant Chapters: 6

Binary As Variant (Read-Only)
Returns the binary image of the file as a Variant-packed safe array of bytes. Useful for saving files in the database using ADO.
Usage:

rs.AddNew
rs("image_blob).Value = File.Binary
rs.Update

Relevant Chapters: 4

ContentType As String (Read-Only)
Returns the uploaded file's Content-Type header value, such as "text/plain" or "application/octet-binary".
Usage:

Response.Write File.ContentType

Relevant Chapters: N/A

CreationTime As Date (Read-Only)
Returns the file's Creation timestamp. This property is not defined if this is a memory file.
Usage:

Response.Write File.CreationTime

Relevant Chapters: N/A

Ext As String (Read-Only)
Returns the file extension.
Usage:

Response.Write File.Ext

Relevant Chapters: 3

FileName As String (Read-Only)
Returns the saved file's name. It may be different from the original file name if unique file generation (the property Upload.OverwriteFiles) is in effect.
Usage:

Response.Write File.FileName

Relevant Chapters: 2

Folder As String (Read-Only)
Returns the saved file's folder. If this is a memory file, the folder will be the same as the original folder.
Usage:

Response.Write File.Folder

Relevant Chapters: N/A

ImageHeight As Long (Read-Only)
Returns the pixel height of an image, or 0 if the file is not an image. Formats supported are BMP, JPG, GIF, and PNG.
Usage:

Response.Write File.ImageHeight

Relevant Chapters: 7

ImageType As String (Read-Only)
Returns the image type. Possible return values are "BMP", "GIF", "JPG", "PNG" for BMP, GIF, JPEG and PNG images, respectively, and "UNKNOWN" if the file is not an image or of an unknown image type.
Usage:

Response.Write File.ImageType

Relevant Chapters: 7

ImageWidth As Long (Read-Only)
Returns the pixel width of an image, or 0 if the file is not an image. Formats supported are BMP, JPG, GIF, and PNG.
Usage:

Response.Write File.ImageWidth

Relevant Chapters: 7

LastAccessTime As Date (Read-Only)
Returns the file's Last Access timestamp. This property is not defined if this is a memory file.
Usage:

Response.Write File.LastAccessTime

Relevant Chapters: N/A

LastWriteTime As Date (Read-Only)
Returns the file's Last Write timestamp. This property is not defined if this is a memory file, unless the file is uploaded with XUpload or JUpload, and the PreserveFileTime feature is enabled.
Usage:

Response.Write File.LastWriteTime

Relevant Chapters: N/A

MD5Hash As String (Read-Only)
Returns the file's MD5 one-way hash value in the Hex format.
Usage:

Response.Write File.MD5Hash

Relevant Chapters: 4

Name As String (Read-Only)
Returns the value of the NAME attribute of this file's <INPUT TYPE=FILE> tag. This property cannot be used to retrieve the file name, use FileName instead.
Usage:

Response.Write File.Name

Relevant Chapters: 2

OriginalFileName As String (Read-Only)
Returns the original name of the uploaded file.
Usage:

Response.Write File.OriginalFileName

Relevant Chapters: N/A

OriginalFolder As String (Read-Only)
Returns the original folder path of the uploaded file.
Usage:

Response.Write File.OriginalFolder

Relevant Chapters: N/A

OriginalPath As String (Read-Only)
Returns the original full path of the uploaded file.
Usage:

Response.Write File.OriginalPath

Relevant Chapters: N/A

OriginalSize As Long (Read-Only)
Returns the original size of the uploaded file. This value may be different from the current size if file truncation is enabled via the SetMaxSize method.
Usage:

Response.Write File.OriginalSize

Relevant Chapters: N/A

Path As Long (Read-Only)
Returns the full path of the uploaded file on the server.
Usage:

Response.Write File.Path

Relevant Chapters: 2

Size As Long (Read-Only)
Returns the size of the uploaded file on the server. It may be different from the original size if the SetMaxSize feature is enabled.
Usage:

Response.Write File.Size

Relevant Chapters: N/A

UploadedFile Methods
Sub AllowAccess (Account As String, Flags As Long)
Adds an allowance access control entity (ACE) corresponding to the specified NT Account to this file's Access Control List (ACL). Flags must be a valid combination of Access Type values defined in the file AspUpload.inc such as GENERIC_ALL. Other valid flag combinations include:
Read (RX):GENERIC_READ + FILE_GENERIC_EXECUTE
Change(RWXD): GENERIC_READ + GENERIC_WRITE + FILE_GENERIC_EXECUTE + DELETE
Full Control (All): GENERIC_ALL


Usage:

File.AllowAccess "jsmith", GENERIC_ALL

Relevant Chapters: 6

Sub Copy (Path As String, Optional Overwrite)
Copies this file to a location specified by Path which must be a fully qualified path.
If Overwrite is set to True or omitted, overwrites an existing file. If Overwrite is set to False and a file at Path already exists, the method will fail.

Usage:

File.Copy "c:\newpath\" & File.FileName

Relevant Chapters: 3

Sub CopyVirtual (VirtualPath As String, Optional Overwrite)
Same as Copy, but expects a virtual rather than physical path. If the system admin disables the Copy method, users are forced to use CopyVirtual which confines them to their own home directory and subdirectories.
Usage:

File.CopyVirtual "/uploads/" & File.FileName

Relevant Chapters: 10

Sub Delete
Deletes the file.
Usage:

File.Delete

Relevant Chapters: 3

Sub DenyAccess (Account As String, Flags As Long)
Adds a denial access control entity (ACE) corresponding to the specified NT Account to this file's Access Control List (ACL). Flags must be set to GENERIC_READ.
Usage:

File.DenyAccess "jsmith", GENERIC_ALL

Relevant Chapters: 6

Sub ExtractFileName
Obsolete. Supported only for backwards compatibility. Use FileName instead.
Usage:

Response.Write File.ExtractFileName

Relevant Chapters: N/A

Sub ExtractFolderName
Obsolete. Supported only for backwards compatibility. Use Folder instead.
Usage:

Response.Write File.ExtractFolderName

Relevant Chapters: N/A

Sub Move (Path As String)
Copies this file to a location specified by Path which must be a fully qualified path. If a file at Path already exists, the method will fail.
Side effect: If the method succeeds, the File.Path property changes to the new path.

Usage:

File.Move "c:\newpath\" & File.FileName

Relevant Chapters: 3

Sub MoveVirtual (VirtualPath As String)
Same as Move, but expects a virtual rather than physical path.
Usage:

File.MoveVirtual "/uploads/" & File.FileName

Relevant Chapters: 10

Sub RevokeAllowance (Account As String)
Removes the corresponding allowance ACE from this file's ACL.
Usage:

File.RevokeAllowance "jsmith"

Relevant Chapters: 6

Sub RevokeDenial (Account As String)
Removes the corresponding denial ACE from this file's ACL.
Usage:

File.RevokeDenial "jsmith"

Relevant Chapters: 6

Sub SaveAs (Path As String)
Saves the file under the name specified by Path. If UploadManager.OverwriteFiles is set to False and a file specified by Path already exists, this method will generate a unique file name by appending a numeric suffix such as (1), (2), etc. to the file name.
This method is especially useful when uploading to memory, as this is the only way to save a memory file to disk.

Side effect: if the method succeeds, the UploadedFile.Path property will be changed to Path (or a unique file name derived from it).

Usage:

File.SaveAs "c:\path\" & File.FileName

Relevant Chapters: 4

Sub SaveAsVirtual (VirtualPath As String)
Same as SaveAs, but expects a virtual rather than physical path. If the system admin disables SaveAs, users will be forced to use SaveAsVirtual which confines them to their home directory and subdirectories.
Usage:

File.SaveAsVirtual "/path/" & File.FileName

Relevant Chapters: 10

Sub SetOwner (Account As String, Flags As Long)
Sets the NTFS owner of this file to the NT Account specified.
Usage:

File.SetOwner "jsmith"

Relevant Chapters: 6

Sub ToDatabase (Connect As String, SQL As String, Optional MSAccessHeaders)
Saves the file specified to the database as a BLOB using ODBC.
Connect is an ODBC connection string which may use a system DSN, or be DSNless, for example:

"DSN=mydb;UID=sa;PWD=xxxxx"

or

"Driver={Microsoft Access Driver (*.mdb)};DBQ=c:\path\db.mdb"

However Connect cannot be an ADO-style connection string, i.e. it cannot reference an OLD DB provider, as this method is based on ODBC.

SQL is an SQL INSERT or UPDATE statement which uses the sign ? as a placeholder for the file being saved in the database, for example:

"INSERT INTO mytable(image_blob, path) values(?, 'c:\path\file.ext')"

or

"UPDATE mytable SET imageblob = ? WHERE id = 15"

The MSAccessHeaders parameter may only be used with MS Access databases. If set to True, AspUpload will attempt to save the file not as a Blob but as an OLE Object so that the document can be invoked directly from MS Access by double-clicking on the table field. This feature will only work with file types for which OLE document servers exist, such as MS Word documents (*.doc), Excel workbooks (*.xls), bitmaps (*.bmp), etc. For other types of files (such as *.gif) the MSAccessHeaders parameter will be ignored and assumed False. Note that you will not be able to download a document saved as an OLE Object directly to the browser.

Usage:

File.ToDatabase "DSN=mydb;UID=sa;PWD=xxxx;", "insert into myimages(image_blob) values(?)"

Relevant Chapters: 4


录入时间:2006-11-01 12:51:56 [打印本页] [关闭窗口] [返回顶部]
特别声明: 本站除部分特别声明禁止转载的专稿外的其他文章可以自由转载,但请务必注明出处和原始作者。文章版权归文章原始作者所有。对于被本站转载文章的个人和网站,我们表示深深的谢意。如果本站转载的文章有版权问题请联系编辑人员,我们尽快予以更正。

Copyright © 2006-2014 0733168.Com Inc All Rights Reserved
关于我们 | 广告合作 | 联系我们 | 法律声明 | 友情链接 | 意见反馈
本站所收录信息、社区话题、及本站所做之广告均属其个人行为,与本站立场无关
湘ICP备06008436号