or
<OBJECT RUNAT=SERVER
PROGID="Persits.Upload.1" ID=Upload>
</OBJECT>
Name | Type (access) | Comments |
Form | Object (read-only) | Returns the Form collection of FormItem objects. Each FormItem object represents a non-file item of the POST form used to upload the files. You should use this Form collection and not Request.Form because of the special ENCTYPE attribute of the form. |
Files | Object (read-only) | Returns the Files collection of UploadedFile objects. Each UploadedFile object represents a successfully uploaded file coming from an <INPUT TYPE=FILE> item on the POST form. |
Directory | Object (read-only);
Parameters: Path As String;
|
Returns a Directory collection of DirectoryItem objects.
The collection represents a folder on your hard drive. Each DirectoryItem
object represents a file or subdirectory in this folder. Path specifies
a valid path and file name which can contain wildcard characters (* and
?). SortBy specifies how items in the collection will be sorted.
It must be set to one of the Sort-by constant value defined in AspUpload.inc.
The default value for this argument is SORTBY_NAME (numeric 1).
Regardless of the value of SortBy, the subfolder items will always precede file items in the collection, and all items will always be sorted in an ascending order. |
OverwriteFiles | Boolean (read-write) | True by default. If set to False, instructs AspUpload to generate unique file names to prevent overwriting existing files in the upload directory. By default, AspUpload will overwrite existing files. |
Name | Arguments/Return Values | Comments |
Save | Dir As String.
Return Value: Integer. |
Parses the posting received from a browser and saves all received files in the directory specified. Returns the number of successfully uploaded files. Throws exceptions in case of an error. |
SaveVirtual | VirtDir As String.
Return Value: Integer |
Same as Save, but takes a virtual, rather than physical, directory
as an argument. This method internally calls Server.MapPath, then
calls the Save method. Therefore, Upload.SaveVirtual(VirtDir)
is equivalent to the call Upload.Save(Server.MapPath(VirtDir)).
In a Web hosting environment, the system administrator may disable the Save method so that AspUpload users would be forced to use SaveVirtual only. See the User Manual for more info on disabling AspUpload's advanced features. |
SetMaxSize | MaxSize As Integer;
Optional Reject = False. |
Specified the maximum allowed size of the files to be uploaded. Reject specifies whether files larger than MaxSize should be rejected (if set to True) or truncated (if set to False or omitted). |
LogonUser | Domain As String;
UserID As String; Password As String; Optional Flag = LOGON_INTERACTIVE. |
Impersonates the specified NT account. If Domain
is empty the local computer will be used to validate the password. Flag
may be one of the following values defined in AspUpload.inc:
LOGON_INTERACTIVE (default value)
Use this function if your current security context does not allow you to perform certain security operations such as manipulating ACLs. |
RevertToSelf | none | Ends the impersonation begun by LogonUser. |
SendBinary | Path As String;
Optional IncludeContentType = True; Optional ContentType; |
Sends the specified file to the browser via Response.BinaryWrite.
If IncludeContentType is set to True or omitted Response.ContentType
will be set to ContentType (if specified), or the appropriate
value based on the file's extension or "application/octet-stream"
if the extension is missing or unknown. The headers Content-Length
and Content-Disposition will be set to the file size and name, respectively.
If IncludeContentType is set to False, the headers will not be set and ContentType will be ignored. |
CreateDirectory | Path As String. | Creates a new directory. |
RemoveDirectory | Path As String. | Removes a directory. |
CopyFile | FromPath As String;
ToPath As String; Optional Overwrite. |
Copies an arbitrary file. FromPath and ToPath must be fully qualified paths. Overwrite, if set to True or omitted, instructs the method to overwrite an existing file. If Overwrite is set to False and a file at ToPath exists, the method will fail |
MoveFile | FromPath As String;
ToPath As String. |
Renames or moves an arbitrary file depending on whether ToPath points to the same or a different directory as FromPath. |
DeleteFile | Path: String | Deletes the specified file. |
CreateFile | Path: String | Creates a zero-length file. |
RegisterServer | DllPath As String;
Optional Register = True. |
Mimics the behavior of REGSVR32 (/u) utility. Registers (unregisters) the specified DLL. If Register is True or omitted, the method registers the DLL, otherwise unregisters it. |
FromDatabase | Connect: String;
SQL: String; Path: String. |
Exports a BLOB from a database table to hard drive. Connect specified an ODBC connection string. SQL is a SELECT statement that must return one record containing a BLOB. The blob data field name must immediately follow the SELECT keyword. Path specifies the destination path. |
Name | Type (access) | Comments |
Path | String (read-only) | Returns this file's local path. |
OriginalSize | Integer (read-only) | Returns this file's original size. |
OriginalPath | String (read-only) | Returns this file's original path on the client machine. |
Size | Integer (read-only) | Returns this file's current size. It may be different from the original size if, for example, the truncation option was enabled via SetMaxSize. |
Name | String (read-only) | Returns the value of the NAME attribute of this file's <INPUT TYPE=FILE> tag. |
Attributes | Long (read-write) | Returns this file's attributes. Can be a combination of file attribute values defined in AspUpload.inc such as FILE_ATTRIBUTE_READONLY. |
Name | Arguments/Return Value | Comments |
ExtractFileName | None.
Return value: String |
Extracts filename.ext from the Path property. |
ExtractFolderName | None.
Return value: String |
Extracts the backslash-terminated folder name from the Path property. |
Copy | NewLocation As String;
Optional Overwrite = True. |
Copies this file. NewLocation must be a fully qualified path. Overwrite, if set to True or omitted, instructs the method to overwrite an existing file. If Overwrite is set to False and a file at NewLocation exists, the method will fail. |
CopyVirtual | NewVirtLocation As String;
Optional Overwrite = True. |
Same as Copy, but takes a virtual path as a parameter. Equivalent to Copy(Server.MapPath(NewVirtLocation), Overwrite). |
Move | NewName As String | Renames or moves this file depending on whether NewName points to the same or a different directory. |
MoveVirtual | NewVirtName As String | Same as Move but takes a virtual path as a parameter. Equivalent to Move(Server.MapPath(NewVirtName)) |
Delete | None. | Deletes this file. You may want to use this method when you save the file in the database and no longer need it on your hard drive. |
ToDatabase | Connect As String;
SQL As String |
Saves this file in the database as a blob.
Connect must be in the format "DSN=datasource;UID=userid;PWD=pwd;". SQL must be an SQL INSERT or UPDATE statement with one '?' sign which serves as a place holder for this file. E.g. "insert into blobs(id, theBlob) values(3, ?)" |
AllowAccess | AccountName As String;
Flag As Long. |
Adds an allowance access control entity (ACE) corresponding to the specified NT account to this file's Access Control List (ACL). Flag must be a valid combination of Access Type values defined in AspUpload.inc. such as GENERIC_ALL. |
DenyAccess | AccountName As String;
Flag As Long. |
Adds a denial access control entity (ACE) corresponding to the specified NT account to this file's ACL. Flag must be set to GENERIC_ALL. |
RevokeAllowance | AccountName As String | Removes the corresponding allowance ACE from this file's ACL. |
RevokeDenial | AccountName As String | Removes the corresponding denial ACE from this file's ACL. |
SetOwner | AccountName As String | Sets the owner of this file to the NT account specified. |
Name | Type (access) | Comments |
Name | String (read-only) | Returns the value of the NAME attribute of this item's <INPUT> tag. |
Value (default property) | String (read-only) | Returns the value of the VALUE attribute of this item's <INPUT> tag. |
Name | Type (access) | Comments |
FileName | String (read-only) | Returns file or directory name. |
FileType | String (read-only) | Returns file type according to file extension and registry settings. For subfolders, this value will be set to "File Folder". For files without an extension, this property will be set to "File". For files with extensions that do not have corresponding registry settings (e.g. .xyz) this property will be set to "XYZ File". |
CreationTime | Date (read-only) | Returns file creation date and time. |
LastAccessTime | Date (read-only) | Returns the time this file was last accessed. |
LastWriteTime | Date (read-only) | Returns the time this file was last modified. |
Attributes | Long (read-only) | Returns file attributes. This value can be a combination of File Attribute constant values defined in AspUpload.inc. |
Size | Long (read-only) | Returns file size in bytes. |
IsSubdirectory | Boolean (read-only) | Returns True is the item represents a subdirectory or False if it represents a file. |
Name | Arguments/Return Value | Comments |
CheckAttribute | Attribute As Long;
Return value: Boolean. |
Check if the specified file attribute is present among this file's attributes. Returns True if Attribute is set, False otherwise. Attribute must be set to one of the File Attribute constant values defined in AspUpload.inc such as FILE_ATTRIBUTE_READONLY. |