📄 object_upload.html
字号:
<FONT COLOR="#0080A0"><B>IgnoreNoPost</B></FONT> As Boolean (Read/Write)
<BLOCKQUOTE>
Suppresses the run-time error "Wrong Content-Type"
when the Upload.Save method is called from a script invoked directly
rather than via a multipart/form-data form.
This property is useful if the form and its corresponding
upload script are placed in the same file.
<P>
<B>Usage:</B><FONT FACE="Courier New"><P>
Upload.IgnoreNoPost = True
</FONT><P>
<B>Relevant Chapters:</B> <A HREF="manual_simple.html">2</A>
</BLOCKQUOTE>
<A NAME="OverwriteFiles">
<FONT COLOR="#0080A0"><B>OverwriteFiles</B></FONT> As Boolean (Read/Write)
<BLOCKQUOTE>
True by default. If set to False, AspUpload generates
a unique file name by appending a numeric index in parentheses
to the original file name if a file with this name already exists
in the upload directory. This property affects the methods Save, SaveVirtual
and <A HREF="object_file.html#SaveAs">File.SaveAs</A>.
<P>
<B>Usage:</B><FONT FACE="Courier New"><P>
Upload.OverwriteFiles = False
</FONT><P>
<B>Relevant Chapters:</B> <A HREF="manual_simple.html">2</A>
</BLOCKQUOTE>
<A NAME="PreserveFileTime">
<FONT COLOR="#0080A0"><B>PreserveFileTime</B></FONT> As Boolean (Read/Write)
<BLOCKQUOTE>
False by default. If set to True,
attempts to preserve the original Last-Modified date of the uploaded file.
<P>
This property is only applicable when using XUpload or JUpload
on the client side. It has no effect when a regular HTML form is used
to upload files. See the XUpload or JUpload manuals for more information.
<P>
<B>Usage:</B><FONT FACE="Courier New"><P>
Upload.PreserveFileTime = False
</FONT><P>
<B>Relevant Chapters:</B> XUpload and JUpload manuals.
</BLOCKQUOTE>
<A NAME="ProgressID">
<FONT COLOR="#0080A0"><B>ProgressID</B></FONT> As String (Read/Write)
<BLOCKQUOTE>
Assign this property to a Progress ID passed from the upload
form when the progress bar is used.
<P>
<B>Usage:</B><FONT FACE="Courier New"><P>
Upload.ProgressID = Request.QueryString("PID")
</FONT><P>
<B>Relevant Chapters:</B> <A HREF="manual_progress.html">5</A>
</BLOCKQUOTE>
<A NAME="RegKey">
<FONT COLOR="#0080A0"><B>RegKey</B></FONT> As String (Read/Write)
<BLOCKQUOTE>
Specifies the registration key. If this property is not set, AspUpload
attempts to read the registration key from the system registry.
<P>
<B>Usage:</B><FONT FACE="Courier New"><P>
Upload.RegKey = "12345-67890-12345"
</FONT><P>
<B>Relevant Chapters:</B> <A HREF="manual_intro.html">1</A>
</BLOCKQUOTE>
<A NAME="TotalBytes">
<FONT COLOR="#0080A0"><B>TotalBytes</B></FONT> As Long (Read-Only)
<BLOCKQUOTE>
Returns the total number of bytes uploaded. Call
this property only after a successful call to the Save (SaveVirtual) method.
This property is useful for reporting purposes.
<P>
<B>Usage:</B><FONT FACE="Courier New"><P>
Response.Write Upload.TotalBytes
</FONT><P>
<B>Relevant Chapters:</B> N/A
</BLOCKQUOTE>
<A NAME="TotalSeconds">
<FONT COLOR="#0080A0"><B>TotalSeconds</B></FONT> As Long (Read-Only)
<BLOCKQUOTE>
Returns the total number of seconds an upload lasted. Call
this property only after a successful call to the Save (SaveVirtual) method.
This property is useful for reporting purposes.
<P>
<B>Usage:</B><FONT FACE="Courier New"><P>
Response.Write Upload.TotalSeconds
</FONT><P>
<B>Relevant Chapters:</B> N/A
</BLOCKQUOTE>
<A NAME="Version">
<FONT COLOR="#0080A0"><B>Version</B></FONT> As String (Read-Only)
<BLOCKQUOTE>
Returns the current version of the component in the format "3.0.0.0".
<P>
<B>Usage:</B><FONT FACE="Courier New"><P>
Response.Write Upload.Version
</FONT><P>
<B>Relevant Chapters:</B> N/A
</BLOCKQUOTE>
<A NAME="Methods">
</BLOCKQUOTE>
<B><FONT COLOR="#0000A0">UploadManager Methods</FONT></B>
<BLOCKQUOTE>
<A NAME="CopyFile">
Sub <FONT COLOR="#00A080"><B>CopyFile</B></FONT> (<I>FromPath</i> As String, <I>ToPath</i> As String, Optional <I>Overwrite</i>)
<BLOCKQUOTE>
Copies a file from <I>FromPath</i> to <I>ToPath</i>.
<P>
<I>Overwrite</i> is True by default. If set to False,
the method will fail if the destination path exists.
<P>
<B>Usage:</B><FONT FACE="Courier New"><P>
Upload.CopyFile "c:\path1\file.ext", "c:\path2\file.ext"
</FONT><P>
<B>Relevant Chapters:</B> N/A
</BLOCKQUOTE>
<A NAME="CreateDirectory">
Sub <FONT COLOR="#00A080"><B>CreateDirectory</B></FONT> (<I>Path</i> As String, Optional <I>IgnoreAlreadyExists</i>)
<BLOCKQUOTE>
Creates a new directory and the entire path of sub-directories leading to it, if necessary.
<P>
<I>IgnoreAlreadyExists</i> is False by default. If set to True,
no error will be thrown if the directory already exists.
<P>
<B>Usage:</B><FONT FACE="Courier New"><P>
Upload.CreateDirectory "c:\dir1\dir2", True
</FONT><P>
<B>Relevant Chapters:</B> <A HREF="manual_memory.html">3</A>
</BLOCKQUOTE>
<A NAME="CreateFile">
Sub <FONT COLOR="#00A080"><B>CreateFile</B></FONT> (<I>Path</i> As String)
<BLOCKQUOTE>
Creates an empty file.
<B>Usage:</B><FONT FACE="Courier New"><P>
Upload.CreateFile "c:\path\file.txt"
</FONT><P>
<B>Relevant Chapters:</B> N/A
</BLOCKQUOTE>
<A NAME="DecryptAndSendBinary">
Sub <FONT COLOR="#00A080"><B>DecryptAndSendBinary</B></FONT> (<I>Path</i> As String, <I>IncludeContentType</i> As Boolean,
<I>ContentType</i> As String,
<I>Key</i> As CryptoKey, <I>RemoveExt</i> As Boolean, Optional <I>Attachment</i>)
<BLOCKQUOTE>
Same as <A HREF="#SendBinary">SendBinary</A>
but decrypts a file before sending it to the client using the
<I>Key</i> object creatable by the AspEncrypt component.
<P>
<I>RemoveExt</i> specifies whether the file extension appended by
Save (with encryption enabled) should be removed from the file name
in the Save As dialog. If <I>Attachment</i> is set to True,
the Content-Disposition header will be include the keyword "attachment;"
to force file downloads under IE. For more information, visit the
AspEncrypt web site at <A HREF="http://www.aspencrypt.com/task_upload.html">www.aspencrypt.com/task_upload.html</A>.
<P>
<I>IgnoreAlreadyExists</i> is False by default. If set to True,
no error will be thrown if the directory already exists.
<P>
<B>Usage:</B><FONT FACE="Courier New"><P>
Upload.DecryptAndSendBinary "c:\dir\file.txt.xxx", True, "application/octet-stream", Key, True, True
</FONT><P>
<B>Relevant Chapters:</B> <A HREF="http://www.aspencrypt.com/task_upload.html">www.aspencrypt.com/task_upload.html</A>
</BLOCKQUOTE>
<A NAME="DeleteFile">
Sub <FONT COLOR="#00A080"><B>DeleteFile</B></FONT> (<I>Path</i> As String)
<BLOCKQUOTE>
Deletes a file specified by <I>Path</i>.
<P>
<B>Usage:</B><FONT FACE="Courier New"><P>
Upload.DeleteFile "c:\path\file.txt"
</FONT><P>
<B>Relevant Chapters:</B> <A HREF="manual_misc.html">9</A>
</BLOCKQUOTE>
<A NAME="FileExists">
Function <FONT COLOR="#00A080"><B>FileExists</B></FONT> (<I>Path</i> As String) As Boolean
<BLOCKQUOTE>
Checks whether the specified file exists. Returns True if it does, False
otherwise.<P>
<B>Usage:</B><FONT FACE="Courier New"><P>
if Upload.FileExists("c:\path\file.txt") Then ...
</FONT><P>
<B>Relevant Chapters:</B> <A HREF="manual_memory.html">3</A>
</BLOCKQUOTE>
<A NAME="FromDatabase">
Sub <FONT COLOR="#00A080"><B>FromDatabase</B></FONT> (<I>Connect</i> As String, <I>SQL</I> As String, <I>Path</i> As String)
<BLOCKQUOTE>
Exports a BLOB from the database table to hard drive using ODBC.
<I>Connect</i> specified an ODBC connection string. <I>SQL</i> is a
SELECT statement that must return one record containing a BLOB.
The blob data field name must immediately follow the SELECT keyword.
<I>Path</i> specifies the destination path.
It must be a fully qualified file path, not just a directory name.
<P>
<B>Usage:</B><FONT FACE="Courier New"><P>
Upload.FromDatabase "DSN=mydb;UID=sa;PWD=xxx;", "select image_blob from myimages where id = 3", "c:\path\file.txt"
</FONT><P>
<B>Relevant Chapters:</B> <A HREF="manual_db.html">4</A>
</BLOCKQUOTE>
<A NAME="FromRecordset">
Sub <FONT COLOR="#00A080"><B>FromRecordset</B></FONT> (<I>RecorsetValue</i> As Variant, <I>Path</i> As String)
<BLOCKQUOTE>
Exports a BLOB from a database table using the ADO Recordset object.
<i>RecordsetValue</i> is a recordset field containing the blob,
such as rs("image_blob").Value.
<I>Path</i> specifies the destination path.
It must be a fully qualified file path, not just a directory name.
<P>
<B>Usage:</B><FONT FACE="Courier New"><P>
Set rs = Server.CreateObject("adodb.recordset")<BR>
rs.Open "MYIMAGES", Connect, 2, 3<BR>
Upload.FromRecordset rs("image_blob").Value, "c:\path\file.txt"
</FONT><P>
<B>Relevant Chapters:</B> <A HREF="manual_db.html">4</A>
</BLOCKQUOTE>
<A NAME="LogonUser">
Sub <FONT COLOR="#00A080"><B>LogonUser</B></FONT> (<I>Domain</i> As String, <I>Username</i> As String, <I>Password</i> As String, Optional <I>Flags</i>)
<BLOCKQUOTE>
Impersonates the specified user account. If <I>Domain</i> is empty,
the local computer will be used to validate the password.
Use this function if your current security context does not allow you to
perform an upload to a remote machine or certain other operations such
as manipulating ACLs.
<P>
<I>Flags</i> may be set to one of the following values:
LOGON_INTERACTIVE (2, default), LOGON_NETWORK (3),
LOGON_BATCH (4), and LOGON_SERVICE (5). Using this optional parameter
is not recommended.
<P>
<B>Usage:</B><FONT FACE="Courier New"><P>
Upload.LogonUser "domain", "jsmith", "xxxxxx"
</FONT><P>
<B>Relevant Chapters:</B> <A HREF="manual_security.html">6</A>
</BLOCKQUOTE>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -