Home
What's New

User Manual
Object Reference
XUpload
XDownload
SelectedFile

Live Demos
Support

Download & Buy

Other Products
Contact Us


XDownload Object XUpload Object

Properties Methods Events
AllowFileMultiSelect
AskAfter
Authorization
CanLaunch
Directory
EnablePopupMenu
Expires
Extensions
FileN
FileCount
Filter
HtmlForm
IncludeDateInfo
IncludeSubfoldersChecked
International
MaxFileCount
MaxFileSize
MaxTotalSize
Password
Port
Proxy
ProxyBypass
ProxyPassword
ProxyUsername
Redirect
RedirectTarget
RedirectURL
RedirectURL2
RegKey
Script
SelectedFiles
Server
ServerReply
ShowErrors
ShowLoginDialog
ShowProgress
SSL
TotalFileSize
Username
Version
ViewServerReply
AddCookie
AddFile
AddFolder
AddFormItem
DisplayProperties
MakeHttpRequest
Remove
RemoveAll
RemoveAllFormItems
RemoveFormItem
RemoveHighlighted
Select
SelectFolder
ShowAboutBox
Stop
Upload
AddFiles
DropFiles
Error
RemoveFiles
ServerReply
Sort
UploadFile
UploadFinish
UploadProgress
UploadStart
WaitingForReply
XUpload Properties
AllowFileMultiSelect As Boolean (Read/Write)
True by default. If set to False, only one file can be selected at a time from the Select Files dialog box. This property was introduced in version 3.1.

Usage: <PARAM NAME="AllowFileMultiSelect" VALUE="False">

AskAfter As Long (Read/Write)
When scanning folders recursively, thousands of files may potentially be selected. For fail-safe purposes, XUpload is programmed to display a warning message every 1000 files. This property enables you to change the default threshold value of 1000 to any other number. Default value: 1000.

Usage: <PARAM NAME="AskAfter" VALUE="5000">

Relevant User Manual Section: 3.6.

Authorization As String (Write-only)
Passes the value of the HTTP_AUTHORIZATION header to XUpload. The header contains the user's encoded username/password.

This property can only be set via a <PARAM> tag as shown below.

Usage: <PARAM NAME="Authorization"
  VALUE="<% = Request.ServerVariables("HTTP_AUTHORIZATION") %>">

Relevant User Manual Section: 3.4.

CanLaunch As Boolean (Read/Write)
If set to True, enables the user to launch (view) a file on the list by double-clicking on it. False by default.

Usage: <PARAM NAME="CanLaunch" VALUE="True">

Directory As String (Read/Write)
Specifies the initial directory for the Select Files and Select Folder dialog boxes. May start with a special personal directory keyword prepended with a @ character, such as @DESKTOP.

Usage: <PARAM NAME="Directory" VALUE="@PERSONAL\My Pictures">

Usage: <PARAM NAME="Directory" VALUE="c:\Photos">

Relevant User Manual Section: 3.1.

EnablePopupMenu As Boolean (Read/Write)
When set to False, disables the pop-up menu when the control is right-clicked on by the user. If the pop-up menu is disabled you must provide an alternative way to invoke XUpload's functionality, such as HTML buttons. True by default.

Usage: <PARAM NAME="EnablePopupMenu" VALUE="False">

Relevant User Manual Section: 2.3.

Expires As Date (Read-only)
Returns 9/9/9999 if a valid registration key is in use. Otherwise returns 0. If XUpload is used a server component and no key is in use, returns the actual expiration date.

Usage: MsgBox XUpload.Expires

Relevant User Manual Section: 1.5.

Extensions As String (Read/Write)
Specifies a comma-separated list of allowed file extensions. An empty string indicates no limitations.

Usage: <PARAM NAME="Extensions" VALUE="jpg,gif,bmp">

Relevant User Manual Section: 3.2.

FileN As String (Write-only)
Specifies a file path to be pre-loaded when the XUpload control comes up. XUpload looks for the parameters File1, File2, File3, etc. until a break in the sequence is encountered. The value must be a full physical path. It may also start with a @-prepended keyword designating a personal user folder such as @DESKTOP or @PERSONAL.

This property can only be set via a <PARAM> tag. To specify a file path programmatically via script, use the method AddFile.

Usage: <PARAM NAME="File1" VALUE="c:\path\file.ext">

Relevant User Manual Sections: 3.3, 3.1.

FileCount As Long (Read-only)
Returns the total number of files currently selected.

Usage: MsgBox XUpload.FileCount

Filter As String (Read/Write)
Specified the file type filters for the Select Files dialog in the form of a list of pairs separated by the pipe character ( | ). Each pair specifies the verbal description of a filter and the filter itself as a list of semicolon-separated wildcards. The elements in a pair are separated by the pipe character as well.

Usage: <PARAM NAME="Filter" VALUE="Images (.gif;.jpg)|*.gif;*.jpg|Documents (.doc)|*.doc|All Files|*.*">

Relevant User Manual Section: 3.1.

HtmlForm As String (Read/Write)
Specifies the HTML form name hosted on the same page. XUpload will automatically scan this form and upload all non-file items from it along with the files.

Usage: <PARAM NAME="HtmlForm" VALUE="MyForm">

Relevant User Manual Section: 2.4.

IncludeDateInfo As Boolean (Read/Write)
When browsers upload files to the server they do not send the "Last Modified" date information together with the files, but XUpload does. The control adds a custom header, "X-Last-Date", to the standard "Content-Disposition" and "Content-Type" MIME headers used in form-based uploading. AspUpload uses this information to preserve the original last-modified dates of the uploaded files.

Setting this property to False disables the X-Last-Date header, which may be useful if the upload component being used is not AspUpload. This header does not seem to cause any problems when the ASP.NET PostedFile object is used. True by default.

Usage: <PARAM NAME="IncludeDateInfo" VALUE="False">

Relevant User Manual Section: 3.5.

IncludeSubfoldersChecked As Boolean (Read/Write)
Changes the default status of the Include Subfolders checkbox on the Select Folder dialog box to from "unchecked" to "checked". False by default.

Usage: <PARAM NAME="IncludeSubfoldersChecked" VALUE="True">

Relevant User Manual Section: 3.6.

International As String (Read/Write)
Specifies a Base64-encoded data block which contains all text strings used by XUpload (menu items, captions and user messages) in a foreign language. This data block is to be obtained at http://support.persits.com/xupload/international.aspx. When this property is specified, all XUpload text strings are replaced by the ones contained in the data block.

Usage: <PARAM NAME="International" VALUE="data block">

Relevant User Manual Section: 5.2.

MaxFileCount As Long (Read/Write)
Specifies the maximum allowed number of files to be uploaded at the same time.

Usage: <PARAM NAME="MaxFileCount" VALUE="50">

Relevant User Manual Section: 3.2.

MaxFileSize As Long (Read/Write)
Specifies the maximum allowed size of individual files in bytes.

Usage: <PARAM NAME="MaxFileSize" VALUE="50000">

Relevant User Manual Section: 3.2.

MaxTotalSize As Long (Read/Write)
Specifies the maximum allowed total size of files in bytes.

Usage: <PARAM NAME="MaxTotalSize" VALUE="150000">

Relevant User Manual Section: 3.2.

Password As String (Read/Write)
Specifies the default password in case basic authentication is enabled on the server. Used together with the Username property.

Usage: <PARAM NAME="Password" VALUE="xxxxxx">

Relevant User Manual Section: 3.4.

Port As Long (Read/Write)
Specifies the TCP/IP port on the server to connect to. If not specified, ports 80 and 443 are used for regular and SSL connections, respectively.

Usage: <PARAM NAME="Port" VALUE="8080">

Relevant User Manual Section: 3.4.

Proxy As String (Read/Write)
Specifies the proxy address when XUpload is used as a server component.

Usage: XUpload.Proxy = "http://myproxy:80"

ProxyBypass As String (Read/Write)
Specifies the proxy bypass when XUpload is used as a server component.
ProxyPassword As String (Read/Write)
Specifies the proxy password when XUpload is used as a server component, if the proxy requires authentication.
ProxyUsername As String (Read/Write)
Specifies the proxy username when XUpload is used as a server component, if the proxy requires authentication.
Redirect As Boolean (Read/Write)
Obsolete, ignored. Supported for backwards compatibility only. See RedirectURL.
RedirectTarget As String (Read/Write)
Specifies the target window or frame for the redirect URL to appear in. If this property is not specified, the URL will appear in the same window or frame as the XUpload control. Valid values are:
  • _blank: load the URL into a new unnamed window;
  • _parent: load the URL into the immediate parent of the document the XUpload control is in;
  • _self: load the URL into the same window the XUpload control is in;
  • _top: load the URL into the full body of the current window;
  • <window_name>: load the URL into a named HTML frame. If no frame or window exists that matches the specified target name, a new window is opened.

Usage: <PARAM NAME="RedirectTarget" VALUE="_blank">

Relevant User Manual Section: 2.2.

RedirectURL As String (Read/Write)
Specifies a URL XUpload should redirect the browser to upon the completion of an upload. If this property is specified, XUpload will POST to the specified URL the results generated by the upload script in the format XUPLOADREPLY=<results>. This URL must point to an ASP script that, at a minimum, must contain the following code: <% Response.Write Request.Form("XUPLOADREPLY") %>. If XUpload is hosted by a container other than IE, this property is ignored.

Usage: <PARAM NAME="RedirectURL" VALUE="http://www.server.com/reply.asp">

Relevant User Manual Section: 2.2.

RedirectURL2 As String (Read/Write)
Specifies a URL XUpload should redirect the browser to upon the completion of an upload. If this property is specified, XUpload will POST to the specified URL the results generated by the upload script as is, without any encoding. Therefore, it is the responsibility of the upload script to encode all relevant information in HTML's URL-encoded form format. See Section 2.2.2 for more information and code samples.

If XUpload is hosted by a container other than IE, or if the RedirectURL parameter is specified, this property is ignored.

This property was introduced in version 3.1 to avoid the "cross-site scripting" warning in IE8.

Usage: <PARAM NAME="RedirectURL2" VALUE="http://www.server.com/reply.asp">

Relevant User Manual Section: 2.2.2.

RegKey As String (Read/Write)
Specifies the registration key which turns an evaluation version of XUpload into a full version.

Usage: <PARAM NAME="RegKey" VALUE="BrxCnX4zjzkh4...ZKMndJBcawbRwA+jq">

Relevant User Manual Section: 1.5.

Script As String (Read/Write)
Specifies the upload script on the server. Used together with the Server property to specify a full URL to upload files to.

Usage: <PARAM NAME="Script" VALUE="/directory/uploadscript.asp">

Relevant User Manual Section: 1.4.

SelectedFiles As Object (Read-only)
Returns a collection of SelectedFile objects. Each object represents a file on the control's list. The SelectedFile object supports the following read-only properties: Path, Size, Index (0-based) and Selected (indicates whether the file is highlighted in the list.)

Usage: For Each File in UploadCtl.SelectedFiles...Next

Relevant User Manual Section: 4.5.

Server As String (Read/Write)
Specifies the server to upload files to. Used together with the Script property to specify a full upload URL. Do not use http:// or https:// with this property. Also, do not specify a port as part of this property, use the Port property instead.

Usage: <PARAM NAME="Server" VALUE="www.server.com">

Relevant User Manual Section: 1.4.

ServerReply As String (Read-only)
Returns a reply from the server once an upload is complete.

Usage: MsgBox UploadCtl.ServerReply

Relevant User Manual Section: 2.1.

ShowErrors As Boolean (Read/Write)
Specifies whether XUpload should display error messages. If set to False, no errors will be reported. In this case an application may need to handle the Error event. True by default.

Usage: <PARAM NAME="ShowErrors" VALUE="False">

ShowLoginDialog As Boolean (Read/Write)
Specifies whether the login dialog box should be shown by XUpload if basic authentication is enabled on the server. If this property is set to False, an upload may fail in case Username/Password properties are invalid. True by default.

Usage: <PARAM NAME="ShowLoginDialog" VALUE="False">

ShowProgress As Boolean (Read/Write)
Specifies whether the progress bar should be displayed. True by default.

Usage: <PARAM NAME="ShowProgress" VALUE="False">

Relevant User Manual Section: 4.2.

SSL As Boolean (Read/Write)
Specifies whether the connection with the server should be made over Secure Socket Layer.

Usage: <PARAM NAME="SSL" VALUE="True">

Relevant User Manual Section: 3.4.

TotalFileSize As Long (Read-only)
Returns the total size of selected files.

Usage: MsgBox UploadCtl.TotalFileSize

Username As String (Read/Write)
Specifies the default username in case basic authentication is enabled on the server. Used together with the Password property.

Usage: <PARAM NAME="Username" VALUE="Administrator">

Relevant User Manual Section: 3.4.

Version As String (Read-only)
Returns the control's current version, e.g. "3.0.0.0".

Usage: MsgBox UploadCtl.Version

ViewServerReply As Boolean (Read/Write)
Specifies whether XUpload should display the Reply from the Server message box with the text returned by the upload script. True by default.

Usage: <PARAM NAME="ViewServerReply" VALUE="False">

Relevant User Manual Section: 2.1.

XUpload Methods
Sub AddCookie (URL As String, Name As String, Data As String)
Creates a cookie associated with the specified URL. Name is a string that contains the name to associate with the cookie data. If this parameter is empty, no name is associated with the cookie. Data is the actual data to associate with the URL.

Usage: UploadCtl.AddCookie "http://www.server.com/path.asp", "myname", "mydata"

Sub AddFile (Path As String)
Adds a file specified by Path to the file list.

Usage: UploadCtl.AddFile "c:\path\file.ext"

Sub AddFolder (Folder As String, Optional Recursive = False)
Adds all files contained in Folder to the file list. If Recursive is set to True, also adds all files in the sub-folders recursively.

As of XUpload 3.1, @-keywords described in Section 3.1 can be used in the folder argument.

Usage: UploadCtl.AddFolder "c:\path", True

Sub AddFormItem (Name As String, Value As String)
Adds a text form item to the control to be uploaded along with the files.

Usage: UploadCtl.AddFormItem "myname", "myvalue"

Relevant User Manual Section: 2.4.

Sub DisplayProperties ( )
Causes the XUpload property sheet to come up. This method must not be called if XUpload is used as a server component.

Usage: UploadCtl.DisplayProperties

Function MakeHttpRequest (Method As String, Params As String, Optional Path, Optional UserAgent, Optional Headers ) As String
Performs an HTTP request using the properties Server, Script, Port, Username and Password.

Method specifies the request type such as "GET" or "POST". Params specify the data to be sent to the server. Leave this parameter empty if Method is "GET". Path, if not empty, instructs the method to save the output in a file. UserAgent and Headers, if not empty, specify additional information to be sent to the server.

Returns the output received from the server.

Usage: UploadCtl.MakeHttpRequest "GET", "", "c:\path\file.txt"

Relevant KB Article: PS01072965.

As of version 3.2, this method can only be called when XUpload is used as a server-side component.

Sub Remove ( Index As Integer )
Removes a file specified by Index (zero-based) from the file list.

This method must not be called if XUpload is used as a server component.

Usage: UploadCtl.Remove 1

Sub RemoveAll ( )
Clears the file list. Has the same effect as choosing "Remove All" from the pop-up menu.

This method must not be called if XUpload is used as a server component.

Usage: UploadCtl.RemoveAll

Relevant User Manual Section: 2.3.

Sub RemoveAllFormItems ( )
Removes all items added by the AddFormItem method.

Usage: UploadCtl.RemoveAllFormItems

Relevant User Manual Section: 2.4.

Sub RemoveFormItem (Name As String)
Removes a form item identified by Name added by the AddFormItem method. If there are multiple form items under the same name, all of them will be removed.

Usage: UploadCtl.RemoveFormItem "myname"

Relevant User Manual Section: 2.4.

Sub RemoveHighlighted ( )
Causes all highlighted items on the file list to be removed. Has the same effect as choosing "Remove" from the pop-up menu.

This method must not be called if XUpload is used as a server component.

Usage: UploadCtl.RemoveHighlighted

Relevant User Manual Section: 2.3.

Sub Select ( )
Causes the Select Files dialog to come up. Has the same effect as choosing "Select Files" from the pop-up menu.

This method must not be called if XUpload is used as a server component.

Usage: UploadCtl.Select

Relevant User Manual Section: 2.3.

Sub SelectFolder ( )
Causes the Select Folder dialog to come up. Has the same effect as choosing "Select Folder" from the pop-up menu.

This method must not be called if XUpload is used as a server component.

Usage: UploadCtl.SelectFolder

Relevant User Manual Section: 2.3.

Sub ShowAboutBox ( )
Causes the About dialog to come up.

This method must not be called if XUpload is used as a server component.

Usage: UploadCtl.ShowAboutBox

Sub Stop ( )
Programmatically stops an upload. Calling this method is equivalent to pressing the Stop button on the progress bar.

Usage: UploadCtl.Stop

Relevant User Manual Section: 4.2.

Sub Upload ( )
Causes an upload process to begin. Has the same effect as choosing "Upload" from the pop-up menu.

Usage: UploadCtl.Upload

Relevant User Manual Section: 2.3.

XUpload Events
Sub AddFiles (Number As Short, Size As Long)
Fires when files are added to the file list. Number specifies the number of files being added, Size specifies total size.
Sub DropFiles (Count As Short)
Fires when files are drag-and-dropped onto the file list. Count specifies the total number of files dropped.

Relevant User Manual Section: 4.1.

Sub Error (Code As Long, Description As String)
Fires when an error occurs. Code can be one of the following values:

1 - Too many files selected by Select Files dialog.
2 - Selecting files failed.
3 - Server not specified.
4 - Script not specified.
5 - Opening HTTP session failed.
6 - Error connecting to the server.
7 - Opening HTTP request failed.
8 - Wrong file extension.
9 - Cannot open file.
10 - Sending HTTP request failed.
11 - Cannot open file during uploading.
12 - Error reading file.
13 - Error sending data.
14 - File number exceeds MaxFileCount.
15 - Reserved.
16 - File size exceeds MaxFileSize.
17 - Total file size exceeds MaxTotalSize.
18 - Control expired.

Sub RemoveFiles (Number As Short, Size As Long)
Fires when files are removed from the file list. Number specifies the number of files being removed, Size specifies total size.
Sub ServerReply (Reply As String)
Fires when a reply is received from the server. Reply specifies the text received.

Relevant User Manual Section: 4.1.

Sub Sort (Column As Short)
Fires when the file list is sorted by clicking on a column header. Column is 0 if the sorting is by file path, 1 if by size.
Sub UploadFile (FileName As String)
Fires right after a file is opened to be uploaded. FileName specifies the file's full path.
Sub UploadFinish ( )
Fires when the upload process ends, but before a reply from the server is received.
Sub UploadProgress (FilePercent As Short, OverallPercent As Short)
Fires multiple times throughout an upload to track progress. FilePercent is an integer between 0 and 100 that specifies the progress of an individual file. OverallPercent is an integer between 0 and 100 that specifies the overall progress.
Sub UploadStart ( )
Fires when an upload starts.
Sub WaitingForReply ( )
Fires right after all files are uploaded but before a reply from the server is received.

Relevant User Manual Section: 4.1.

XDownload Object 

Home
Copyright © 1998 - 2010 Persits Software, Inc.
All Rights Reserved.
XUpload™ is a trademark of Persits Software, Inc.