📄 object_file.html
字号:
Returns the original folder path of the uploaded file.
<P>
<B>Usage:</B><FONT FACE="Courier New"><P>
Response.Write File.OriginalFolder
</FONT><P>
<B>Relevant Chapters:</B> N/A
</BLOCKQUOTE>
<A NAME="OriginalPath">
<FONT COLOR="#0080A0"><B>OriginalPath</B></FONT> As String (Read-Only)
<BLOCKQUOTE>
Returns the original full path of the uploaded file.
<P>
<B>Usage:</B><FONT FACE="Courier New"><P>
Response.Write File.OriginalPath
</FONT><P>
<B>Relevant Chapters:</B> N/A
</BLOCKQUOTE>
<A NAME="OriginalSize">
<FONT COLOR="#0080A0"><B>OriginalSize</B></FONT> As Long (Read-Only)
<BLOCKQUOTE>
Returns the original size of the uploaded file. This value may be different
from the current size if file truncation is enabled via the
<A HREF="object_upload.html#SetMaxSize">SetMaxSize</A> method.
<P>
<B>Usage:</B><FONT FACE="Courier New"><P>
Response.Write File.OriginalSize
</FONT><P>
<B>Relevant Chapters:</B> N/A
</BLOCKQUOTE>
<A NAME="Path">
<FONT COLOR="#0080A0"><B>Path</B></FONT> As Long (Read-Only)
<BLOCKQUOTE>
Returns the full path of the uploaded file on the server.
<P>
<B>Usage:</B><FONT FACE="Courier New"><P>
Response.Write File.Path
</FONT><P>
<B>Relevant Chapters:</B> <A HREF="manual_simple.html">2</A>
</BLOCKQUOTE>
<A NAME="Size">
<FONT COLOR="#0080A0"><B>Size</B></FONT> As Long (Read-Only)
<BLOCKQUOTE>
Returns the size of the uploaded file on the server. It may be different
from the original size if the <A HREF="object_upload.html#SetMaxSize">SetMaxSize</A> feature is enabled.
<P>
<B>Usage:</B><FONT FACE="Courier New"><P>
Response.Write File.Size
</FONT><P>
<B>Relevant Chapters:</B> N/A
</BLOCKQUOTE>
<A NAME="Methods">
</BLOCKQUOTE>
<B><FONT COLOR="#0000A0">UploadedFile Methods</FONT></B>
<BLOCKQUOTE>
<A NAME="AllowAccess">
Sub <FONT COLOR="#00A080"><B>AllowAccess</B></FONT> (<I>Account</i> As String, <I>Flags</i> As Long)
<BLOCKQUOTE>
Adds an allowance access control entity (ACE) corresponding to the
specified NT <I>Account</i> to this file's Access Control List (ACL).
<I>Flags</i> must be a valid combination of Access Type values defined in
the file <B>AspUpload.inc</B> such as GENERIC_ALL. Other valid flag combinations include:<P>
Read (RX):GENERIC_READ + FILE_GENERIC_EXECUTE<BR>
Change(RWXD): GENERIC_READ + GENERIC_WRITE + FILE_GENERIC_EXECUTE + DELETE<BR>
Full Control (All): GENERIC_ALL<BR>
<P>
<B>Usage:</B><FONT FACE="Courier New"><P>
File.AllowAccess "jsmith", GENERIC_ALL
</FONT><P>
<B>Relevant Chapters:</B> <A HREF="manual_security.html">6</A>
</BLOCKQUOTE>
<A NAME="Copy">
Sub <FONT COLOR="#00A080"><B>Copy</B></FONT> (<I>Path</i> As String, Optional <I>Overwrite</i>)
<BLOCKQUOTE>
Copies this file to a location
specified by <I>Path</i> which must be a fully qualified path.<P>
If <I>Overwrite</i> is set to True or omitted,
overwrites an existing file. If <I>Overwrite</i> is set to
False and a file at <I>Path</i> already exists, the method will fail.
<P>
<B>Usage:</B><FONT FACE="Courier New"><P>
File.Copy "c:\newpath\" & File.FileName
</FONT><P>
<B>Relevant Chapters:</B> <A HREF="manual_memory.html">3</A>
</BLOCKQUOTE>
<A NAME="CopyVirtual">
Sub <FONT COLOR="#00A080"><B>CopyVirtual</B></FONT> (<I>VirtualPath</i> As String, Optional <I>Overwrite</i>)
<BLOCKQUOTE>
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.
<P>
<B>Usage:</B><FONT FACE="Courier New"><P>
File.CopyVirtual "/uploads/" & File.FileName
</FONT><P>
<B>Relevant Chapters:</B> <A HREF="manual_share.html">10</A>
</BLOCKQUOTE>
<A NAME="Delete">
Sub <FONT COLOR="#00A080"><B>Delete</B></FONT>
<BLOCKQUOTE>
Deletes the file.
<P>
<B>Usage:</B><FONT FACE="Courier New"><P>
File.Delete
</FONT><P>
<B>Relevant Chapters:</B> <A HREF="manual_memory.html">3</A>
</BLOCKQUOTE>
<A NAME="DenyAccess">
Sub <FONT COLOR="#00A080"><B>DenyAccess</B></FONT> (<I>Account</i> As String, <I>Flags</i> As Long)
<BLOCKQUOTE>
Adds a denial access control entity (ACE) corresponding to the
specified NT <I>Account</i> to this file's Access Control List (ACL).
<I>Flags</i> must be set to GENERIC_READ.
<P>
<B>Usage:</B><FONT FACE="Courier New"><P>
File.DenyAccess "jsmith", GENERIC_ALL
</FONT><P>
<B>Relevant Chapters:</B> <A HREF="manual_security.html">6</A>
</BLOCKQUOTE>
<A NAME="ExtractFileName">
Sub <FONT COLOR="#00A080"><B>ExtractFileName</B></FONT>
<BLOCKQUOTE>
Obsolete. Supported only for backwards compatibility.
Use <A HREF="#FileName">FileName</A> instead.
<P>
<B>Usage:</B><FONT FACE="Courier New"><P>
Response.Write File.ExtractFileName
</FONT><P>
<B>Relevant Chapters:</B> N/A
</BLOCKQUOTE>
<A NAME="ExtractFolderName">
Sub <FONT COLOR="#00A080"><B>ExtractFolderName</B></FONT>
<BLOCKQUOTE>
Obsolete. Supported only for backwards compatibility.
Use <A HREF="#Folder">Folder</A> instead.
<P>
<B>Usage:</B><FONT FACE="Courier New"><P>
Response.Write File.ExtractFolderName
</FONT><P>
<B>Relevant Chapters:</B> N/A
</BLOCKQUOTE>
<A NAME="Move">
Sub <FONT COLOR="#00A080"><B>Move</B></FONT> (<I>Path</i> As String)
<BLOCKQUOTE>
Copies this file to a location
specified by <I>Path</i> which must be a fully qualified path.
If a file at <I>Path</i> already exists, the method will fail.
<P>
<B>Side effect:</B> If the method succeeds, the File.Path property changes to the new path.
<P>
<B>Usage:</B><FONT FACE="Courier New"><P>
File.Move "c:\newpath\" & File.FileName
</FONT><P>
<B>Relevant Chapters:</B> <A HREF="manual_memory.html">3</A>
</BLOCKQUOTE>
<A NAME="MoveVirtual">
Sub <FONT COLOR="#00A080"><B>MoveVirtual</B></FONT> (<I>VirtualPath</i> As String)
<BLOCKQUOTE>
Same as Move, but expects a virtual rather than physical path.
<P>
<B>Usage:</B><FONT FACE="Courier New"><P>
File.MoveVirtual "/uploads/" & File.FileName
</FONT><P>
<B>Relevant Chapters:</B> <A HREF="manual_share.html">10</A>
</BLOCKQUOTE>
<A NAME="RevokeAllowance">
Sub <FONT COLOR="#00A080"><B>RevokeAllowance</B></FONT> (<I>Account</i> As String)
<BLOCKQUOTE>
Removes the corresponding allowance ACE from this file's ACL.
<P>
<B>Usage:</B><FONT FACE="Courier New"><P>
File.RevokeAllowance "jsmith"
</FONT><P>
<B>Relevant Chapters:</B> <A HREF="manual_security.html">6</A>
</BLOCKQUOTE>
<A NAME="RevokeDenial">
Sub <FONT COLOR="#00A080"><B>RevokeDenial</B></FONT> (<I>Account</i> As String)
<BLOCKQUOTE>
Removes the corresponding denial ACE from this file's ACL.
<P>
<B>Usage:</B><FONT FACE="Courier New"><P>
File.RevokeDenial "jsmith"
</FONT><P>
<B>Relevant Chapters:</B> <A HREF="manual_security.html">6</A>
</BLOCKQUOTE>
<A NAME="SaveAs">
Sub <FONT COLOR="#00A080"><B>SaveAs</B></FONT> (<I>Path</i> As String)
<BLOCKQUOTE>
Saves the file under the name specified by <i>Path</i>.
If UploadManager.OverwriteFiles is set to False and a file specified by
<I>Path</i> already exists, this method will generate a unique file name by
appending a numeric suffix such as (1), (2), etc. to the file name.
<P>
This method is especially useful when uploading to memory,
as this is the only way to save a memory file to disk.
<P>
<B>Side effect</B>: if the method succeeds, the
UploadedFile.Path property will be changed to <I>Path</i>
(or a unique file name derived from it).
<P>
<B>Usage:</B><FONT FACE="Courier New"><P>
File.SaveAs "c:\path\" & File.FileName
</FONT><P>
<B>Relevant Chapters:</B> <A HREF="manual_db.html">4</A>
</BLOCKQUOTE>
<A NAME="SaveAsVirtual">
Sub <FONT COLOR="#00A080"><B>SaveAsVirtual</B></FONT> (<I>VirtualPath</i> As String)
<BLOCKQUOTE>
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.
<P>
<B>Usage:</B><FONT FACE="Courier New"><P>
File.SaveAsVirtual "/path/" & File.FileName
</FONT><P>
<B>Relevant Chapters:</B> <A HREF="manual_share.html">10</A>
</BLOCKQUOTE>
<A NAME="SetOwner">
Sub <FONT COLOR="#00A080"><B>SetOwner</B></FONT> (<I>Account</i> As String, <I>Flags</i> As Long)
<BLOCKQUOTE>
Sets the NTFS owner of this file to the NT Account specified.
<P>
<B>Usage:</B><FONT FACE="Courier New"><P>
File.SetOwner "jsmith"
</FONT><P>
<B>Relevant Chapters:</B> <A HREF="manual_security.html">6</A>
</BLOCKQUOTE>
<A NAME="ToDatabase">
Sub <FONT COLOR="#00A080"><B>ToDatabase</B></FONT> (<i>Connect</i> As String, <I>SQL</i> As String, Optional <I>MSAccessHeaders</i>)
<BLOCKQUOTE>
Saves the file specified to the database as a BLOB using ODBC.
<P>
<I>Connect</i> is an ODBC connection string which may use a system DSN,
or be DSNless, for example:
<P>
<B>"DSN=mydb;UID=sa;PWD=xxxxx"</B><P>
or<P>
<B>"Driver={Microsoft Access Driver (*.mdb)};DBQ=c:\path\db.mdb"</B>
<P>
However <I>Connect</i> cannot be an ADO-style connection string, i.e. it
cannot reference an OLD DB provider, as this method is based on ODBC.
<P>
<I>SQL</i> is an SQL INSERT or UPDATE statement which uses the sign ?
as a placeholder for the file being saved in the database, for example:
<P>
"INSERT INTO mytable(image_blob, path) values(?, 'c:\path\file.ext')"<P>
or<P>
"UPDATE mytable SET imageblob = ? WHERE id = 15"
<P>
The <I>MSAccessHeaders</i> 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.
<P>
<B>Usage:</B><FONT FACE="Courier New"><P>
File.ToDatabase "DSN=mydb;UID=sa;PWD=xxxx;", "insert into myimages(image_blob) values(?)"
</FONT><P>
<B>Relevant Chapters:</B> <A HREF="manual_db.html">4</A>
</BLOCKQUOTE>
<P>
<A HREF="object_formitem.html"><IMG BORDER="0" SRC="next.gif" ALIGN="RIGHT" ALT="FormItem Object"></A>
<A HREF="object_upload.html"><IMG BORDER="0" SRC="previous.gif" ALIGN="RIGHT" ALT="UploadManager Object"></A>
<P>
</BLOCKQUOTE>
</FONT>
<P>
<TABLE WIDTH=540 HEIGHT=2 CELLSPACING=0 CELLPADDING=0 BORDER=0>
<TD BGcolor="#FFCE00"><spacer type=block width=540 height=2></TD>
</TABLE>
<P>
<CENTER>
<A HREF="index.html"><IMG SRC="logo_small.gif" BORDER=0></A>
<BR>
<FONT Face=arial size=1>
Copyright © 1998 - 2001 <A HREF="http://www.persits.com">Persits Software, Inc.</A><BR>
All Rights Reserved<BR>
AspUpload® is a registered trademark of Persits Software, Inc.<BR>
Questions? Comments? <A HREF="MAILTO:info@aspupload.com">Write us!</A>
</CENTER>
</TD>
</TABLE>
</BASEFONT>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -