What is CuteUpload?
CuteUpload is a client-side ActiveX control used to upload
files from a user's machine to web server or download files from web(HTTP or FTP) server, it conforms to the RFC1867 Form-based File Upload in HTML standard.
The purpose of CuteUpload is to overcome numerous limitations of purely browser-based
upload solutions. With CuteUpload,user can upload files to the server from
a web page viewed by Microsoft Internet Explorer, from a custom application
built with Visual Basic, Visual C++ or any other platform supporting ActiveX.
As a common technical reason, the ActiveX controls can only be
used with containers supporting ActiveX. CuteUpload does not work on FireFox or Netscape
browsers as they currently do not support ActiveX. CuteUpload
can
only be used on Win32 platforms such as Windows 95/98/Me/NT/2000/2003/XP. It
will not work on Macintosh or Linux machines at the moment.
The CuteUpload 1.5 control uses the Microsoft Internet
Explorer 4.0 WinInet API. Therefore, CuteUpload requires that Microsoft
Internet Explorer 4.0+ be installed, even if the control is used in
containers other than IE.
What are the features of CuteUpload 1.5
The following list are the main features of CuteUpload 1.5:
- Upload/download multiple files at once
- Drag & drop, copy & paste and multiple file selection
- Fully support of Unicode
- Integrated upload and download features in one control
- Recursive folder selection
- File upload/download progress bar showing uploads/downloads of each files and overall progress
- "Time left, time elapsed, transfer rate, upload/download progress bar and upload/download percentage" indicators
- Redirects browser to another page upon completion of an upload
- Supports basic and NTLM authentication
- RFC1867-compliant
- Works under SSL
- User friendly interface, with toolbar and right click pop up menu supported
- Allows a default folder for file selection
- Allows custom file filters for the "Select Files" dialog
- Allows set limit of file number, size and extension before upload begins
- Fires events for client-side JavaScript, VBScript and VB apps to handle, simple interaction between JavaScript, VBScript and the CuteUpload Control
- Allows change property settings on the fly
- Works in "silent" mode without displaying error messages
- Allows displaying a reply from the server
- Supports non-file HTML form elements
- Allows form validation upon file upload
- Free server PHP, Perl, ASP, ASP .Net and Java server side file upload code works well with CuteUpload
- Can be embeded into your Windows/Web application
Limitations of Form-based File Uploading
With regular HTML form based file upload, the HTML code contains Tags like: <FORM METHOD="POST"
ENCTYPE="multipart/form-data">. This form must contain one or more items
of the HTML Tag <INPUT TYPE=FILE>. The RFC1867-compliant browsers display such items as regular
text boxes with the button "Browse..." next to them. Clicking the Browse
button opens the standard Choose File dialog box which allows the user
to select a file for uploading. The limitations of form-based file uploading
as following:
-
The "Choose File" dialog does not allow multiple selections
-
To upload multiple files at once, the HTML form must contain multiple <INPUT
TYPE=FILE> tags, each file needs to be selected individually
-
A folder cannot be selected for uploading
-
Default values for the file names can not be pre-set (the VALUE attribute
is ignored for <INPUT TYPE=FILE> tags)
-
There is no progress bar
-
There is no way to set a default directory to select the files from
-
There is no way to specify file filters to be displayed in the Files
of type drop down list of the "Choose File" dialog
-
There is no way to put a limit of the size and number of files being uploaded
before uploading begins
-
There is no way to force users to select files with certain extensions
-
Aside from the file path, browsers do not send any information about the
files being uploaded, so the file dates cannot be preserved
-
Uploading cannot be performed in a batch process
All these limitations can be overcome with the help
of the CuteUpload control
Installation
By default, the CuteUpload setup program will create the installation folder {CuteUpload Edition Name} under \Program Files\Eversun Software\ directory. There are Bin, Examples, UserManual folders under the
installation folder. Make sure all the folders have been successfully created and not empty.
If necessary, re-install it.
Using CuteUpload with Internet Explorer
When used with IE, the CuteUpload control runs inside an HTML
page on a client machine. The HTML page must reference the control using
the <OBJECT> tag, a sample as follows:
<OBJECT
WIDTH=500 HEIGHT=250
ID="CuteUpload"
CLASSID="CLSID:3F7B8083-E290-4CBE-8361-2C15370BBF2E"
CODEBASE="CuteUpload.cab#Version=1,5,3,6">
...
</OBJECT>
Please refer to the follow CLASSID and CODEBASE values for different CuteUpload editions:
| CuteUpload Edition |
Control Name |
CLASSID |
CODEBASE (CuteUpload cab file name) |
| English Free Edition |
Upload Control |
8036B0D5-7572-443c-ACA0-620FBCC3F718 |
CuteUpload-Free.cab#Version=1,5,3,6 |
| Download Control |
DD2E58C6-116C-47F9-AC1F-D3CA8E6FFA87 |
| Chinese Free Edition |
Upload Control |
83E02F64-9A42-4057-BD05-29CCE71FFB2F |
CuteUpload-Free-ch.cab#Version=1,5,3,6 |
| Download Control |
17A59C49-139F-4CAF-A64A-FD9E99E1C460 |
| English Commerial Edition |
Upload Control |
3F7B8083-E290-4CBE-8361-2C15370BBF2E |
CuteUpload.cab#Version=1,5,3,6 |
| Download Control |
BB16B79D-1308-4315-8764-2B77914F94FF |
| Chinese Commercial Edition |
Upload Control |
3B763152-F47B-4CE4-9149-1ABCAE77BB7E |
CuteUpload-ch.cab#Version=1,5,3,6 |
| Download Control |
D8C2CE52-F42E-44CB-96BE-CACBBBB3900E |
Since CuteUpload runs on client machines, it does not need to be registered on the Web server
but it does need to be placed in a
virtual directory together with HTML pages it is referenced by so that
the browser, after coming across the <OBJECT> tag, can download the CuteUpload cab
file to the client machine and register it there.
The WIDTH and HEIGHT attributes of the <OBJECT> tag
define the size of the control inside the page. The ID attribute
identifies the CuteUpload object so that it can be used by client-side VB
Script. The CLASSID attribute specifies the CuteUpload control's globally
unique identifier (GUID) which the browser uses to create an instance of
the control. The CODEBASE attribute specifies where the CuteUpload cab file
resides relative to the current HTML page.
If you put the CuteUpload sample files under the sub-folder: "cuteupload" of your local HTTP web server, and the port number of your web server is 80, you may open the URL http://localhost/cuteupload/simple.html with IE to run the demo.
If the CuteUpload cab file has not been registered on your machine, you should
see a dialog box similar to this one:
The CuteUpload cab file was digitally signed to provide proof
that the control you are about to install on the machine really came from
Eversun Software, Corp., and that it was not changed during transmission.
Click "Install" to have the browser install the control on your computer.
You should now be able to see the control inside your web page. It looks
like a regular Win32 list control with three columns: Files, Size and Type. Right-click
anywhere inside the control. A pop-up menu appears with five menu items,
"Select Files", "Select Folder", "Remove Selected", "Remove All" and "Upload".
The Remove Selected, Remove All and Upload items are grayed out when there
is no files selected. Choose Select Files to open the standard
"Select Files" dialog box. Choose a few files and click OK. The selected
files appear in CuteUpload's list control with their respective icons, size and
type information. We can now remove any or all files from the list by highlighting
the appropriate items, right-clicking inside the control and choosing Remove
or
Remove All. We can also sort the items alphabetically, by size or type by clicking on the Files, Size or Type headers, respectively.
At the very minimum, you must supply values for two CuteUpload properties:
Server, Script. The Server property specifies the address of
a destination web server, such as "localhost" or "127.0.0.1".
The Script property is the path to an upload script on that server,
such as "/sample/cuteupload_server_script.php". These two properties together serve
the same purpose as the ACTION attribute of an HTML POST form. If the Server property value is not localhost nor 127.0.0.1, then the LicenseKey property must be supplied with correct value that matches your Server property. To apply for the License Key, you need to input correct domain name of the server when you download CuteUpload from www.cuteupload; if you intent to change the LicenseKey due to the change of server name, please contact CuteUpload support team.
NOTE: All the CuteUpload samples installed on your machine use
the value "localhost" for the Server property and "/cuteupload/<script
name>" for the Script property. Please change these values accordingly.
The properties of an ActiveX control can be specified using <PARAM>
tags placed between the <OBJECT ...> and </OBJECT> tags, for example:
<OBJECT
WIDTH=500 HEIGHT=250
ID="CuteCtrl"
CLASSID="CLSID:8036B0D5-7572-443c-ACA0-620FBCC3F718" CODEBASE="CuteUpload-Free.cab">
<PARAM
NAME="Server" VALUE="localhost">
<PARAM
NAME="Script" VALUE="/cuteupload/cuteupload-php-file-receive-script.php">
</OBJECT>
This sample uses the PHP upload script cuteupload-php-file-receive-script.php included with the
CuteUpload control. To define the folder for the uploaded files, you need to assign value to the TARGET_DIR variable in the script,
you should make sure this directory exists or edit the script to specify
a different directory.
Select a few files again and perform upload action. A dialog box with two
progress bars appears. Once the upload is complete, a message box titled
"CuteUpload" pops up:
The text inside the message box came directly from the server and was
generated by our upload script. We will see shortly how to make CuteUpload
redirect the browser to another page upon the completion of an upload.
CuteUpload can be configured not to display the Reply from Server message
box by setting the ViewServerReply property to False as follows:
<PARAM
NAME="ViewServerReply" VALUE="False">
If you choose to do so your application may need to provide some other
means to report server replies to the user, such as handling the ServerReply
event (see section Handling Events.)
Browser Redirection
With CuteUpload 1.5, the browser can open a different web page upon the completion
of an upload that would display the upload results. To archive that effect, two server scripts are necessary: the
first one works as a regular upload script, and the second does nothing
but display the HTML output generated by the first script. The following
additional parameters (besides the required Server and Script) configure
CuteUpload to perform the redirection:
<PARAM NAME="RedirectURL" VALUE="http://localhost/cuteupload/showreply.php">
If the RedirectURL is null string, the browser will not relocate to other page.
<PARAM NAME="AutoRedirect" VALUE="True">
The AutoRedirect property, if set to True, instructs browser redirect to another page after upload if the server feedback a redirect response. If it is set to false, after uploading, the browser will not redirect no matter what the server's response is. This feature helps lots of file uploading application in many special circumstances.
CuteUpload live demo
at http://www.cuteupload.com/cuteupload_demo.php.
Customization and
Populating
default upload/download file list
Source parameter is used to define the initial file list in the control.
CuteUpload can be configured to populate its file list automatically upon loading. You can add as much as item you want by using HTML code. The formation is SourceN(1..N), and the N should be continual and started from 1. The initial file list to be uploaded can be defined in the HTML script as following demo:
...
<param Name="Source1" Value="C:\file1" />
<param Name="Source2" Value="C:\file2" />
<param Name="Source3" Value="C:\file3" />
...
There are two parameters in download control. SourceN is used to define the source URL of the HTTP or FTP source. DestinationN is used to define the destination folder or filename the file should be stored in client's local storage. N should be continual and started from 1. It is the same to initialize the download url list in the download control:
...
<param name="Source1" value="http://www.cuteupload.com/sample/Blue hills.jpg" />
<param name="Destination1" value="C:\" />
<param name="Source2" value="http://www.cuteupload.com/sample/Sunset.jpg" />
<param name="Destination2" value="C:\" />
<param name="Source3" value="http://www.cuteupload.com/sample/Water lilies.jpg" />
<param name="Destination3" value="C:\" />
<param name="Source4" value="http://www.cuteupload.com/sample/Winter.jpg" />
<param name="Destination4" value="C:\" />
...
The sample file download_demo_en.php demonstrates this feature.
Configuring Select Files for Uploading
Dialog
An important advantage of CuteUpload over
a purely browser-based solution is being able to specify the "Select Files"
dialog's default directory and file filters. The corresponding properties
are DefaultFolder and FileFilter. The usage of the InitDirectory
property is straightforward:
<PARAM
NAME="DefaultFolder" VALUE="c:\My Documents\Reports">
The FileFilter property accepts a list of pairs
separated by the pipe character ( | ). Each pair defines a verbal description
for a filter and the filter itself which may contain one or more wildcards
separated by a semicolon (;). The two values in the pair are also separated
by the pipe character. For example,
<PARAM
NAME="FileFilter" VALUE="Images (.gif;.jpg)|*.gif;*.jpg|Documents (.doc)|*.doc|All
Files|*.*">
Here we specify three filters. The first filter
has the verbal description "Images (.gif;.jpg)" and consists of two wildcards,
*.gif and *.jpg. The second filter has the description "Documents (.doc)"
and is defined by the wildcard *.doc. The third filter is "All Files" with
the wildcard *.*.
Setting Limits on Files Being Uploaded
CuteUpload enables you to impose certain restrictions on the files
being uploaded, so that the files not meeting the restrictions are rejected
before
an upload begins. The restrictions are set via the properties MaxFileCount,
MaxFileSize, MaxTotalSize and Extensions. The MaxFileCount property,
if set to a non-zero value, limits the total number of files selected for
uploading. The MaxFileSize property, if set to a non-zero value,
places a limit on the size of individual files (in bytes). The MaxTotalSize
property, if set to a non-zero value, sets a limit on the total size of
files selected for uploading (in bytes). These three properties are 0 by
default. The Extensions property can be used to specify a list of
acceptable file extensions. For example,
<PARAM
NAME="MaxFileSize" VALUE="50000">
<PARAM
NAME="MaxTotalSize" VALUE="200000">
<PARAM
NAME="MaxFileCount" VALUE="10">
<PARAM
NAME="Extensions" VALUE="gif,doc,jpg">
The Extensions restriction is enforced at the time of adding
a file to the list. The other three restrictions are enforced at the time
when CuteUpload is instructed to start an upload (via the user interface or
Upload
method.) An attempt to upload a set of files not meeting the MaxXXX
restrictions results in an error message being displayed by the control.
Handling Basic Authentication and SSL
When CuteUpload attempts to upload to a server protected by Basic
Authentication, it displays a dialog box asking the user for his/her username
and password which are then sent to the server. You can use the Username
and Password properties to specify default credentials that will
be used by CuteUpload. If these credentials are valid, CuteUpload will go ahead
with uploading and no login dialog will be displayed. If the credentials
are rejected by the server, CuteUpload will display an error messagebox.
If the server requires a Secure Socket Layer connection (SSL) you must
set the EnableSSL property to True, as follows:
<PARAM
NAME="EnableSSL" VALUE="True">
Using Client-Side VBScript
You may customize the appearance and behavior of CuteUpload on
your Web page using client-side VBScript. The following code disables the
control's popup menu and creates four buttons with the same functionality
as the menu's items:
<SCRIPT language=VBSCRIPT>
Sub CuteCtrl_UploadFinish()
MsgBox("upload finish")
End Sub
Sub CuteCtrl_UploadProgress(filepercent, overall)
document.getElementById("outp").innerHtml=overall&"%"
End Sub
</SCRIPT>
<HTML><BODY>
<OBJECT WIDTH="500" HEIGHT="250" CODEBASE="CuteUpload-Free.cab#Version=1,5,1,0" ID="CuteCtrl" CLASSID="CLSID:8036B0D5-7572-443c-ACA0-620FBCC3F718">
<PARAM NAME="Server" VALUE="localhost">
<PARAM NAME="Script" VALUE="/cuteupload_server_script.php">
<PARAM NAME="Port" VALUE="80">
<PARAM NAME="MaxFileCount" VALUE="30">
<PARAM NAME="MaxFileSize" VALUE="524288000">
<PARAM NAME="MaxTotalSize" VALUE="524288000">
<PARAM NAME="EnablePopupMenu" VALUE="True">
<PARAM NAME="DefaultFolder" VALUE="C:\">
<PARAM NAME="FileFilter" VALUE="All Files|*.*">
<PARAM NAME="EnableRedirect" VALUE="True">
<PARAM NAME="RedirectURL" VALUE="showreply.php">
</OBJECT>
</BODY></HTML>
|
Another example of operating CuteUpload with VBScript can be found in the
sample file Buttons.htm.
File Lists Operation via Javascript/VBScript
You may need to save some file related information. The upload control can provide this feature via FileList's FileItem Interface.
First, you can get FileList object from the upload or download control. Then
var object = document.getElementsById("CuteCtrl");
var fileList = object.FileList;
for(i=1; i<=fileList.Count; i++)
{
var fileItem = fileList(i);
... // You can now access
... // fileItem.Path; fileItem.Name; fileItem.Caption; fileItem.Comment
... // for the specified file item;
}
For VBScript:
Set items = CuteCtrl.FileList
For Each item In items
... // You can now access
... // item.Path; item.Name; item.Caption; item.Comment
... // for the specified file item;
Next
Another example of operating CuteUpload with VBScript can be found in the
sample file Buttons.htm.
Uploading Non-File Form Items
It is often necessary to upload additional information together
with the files, such as a text description. In browser-based uploading,
this is handled by adding non-file items to the HTML form, for example:
<FORM METHOD="POST"
ENCTYPE="multipart/form-data" ACTION="UploadScript.asp">
File 1:<INPUT TYPE=FILE
NAME="FILE1">
File 2:<INPUT TYPE=FILE
NAME="FILE2">
Description:<INPUT
TYPE=TEXT NAME="DESCR">
<INPUT TYPE=SUBMIT
VALUE="Upload!">
</FORM>
CuteUpload 1.5 is capable of collecting all non-file form items from an
HTML form hosted on the same page and uploading these items along with
files. The property FormName is used to specify the name of the
form, as follows:
<OBJECT ID="CuteCtrl"
...
<PARAM NAME="FormName" VALUE="MyForm">
</OBJECT>
<FORM NAME="MyForm">
<INPUT TYPE=TEXT NAME="Descr">
... other form items
</FORM>
Click to see a sample that demonstrates Non-File Form Items support in CuteUpload.
Populating Customized Form Items Into CuteUpload
CuteUpload has a feature to enable use to add a HTML form item by using any kind of server-side scripting language. Using the name/value pair parameter, CuteUpload will send the customized items to server upon the file uploading.
<SCRIPT LANGUAGE="VBScript">
...
CuteCtrl.AddFormItem(name, value)
...
</SCRIPT> |
Set Upload Files' Form Field Name
In some circumstances, server code may need the specified file uploading form field name related to file. For example, PHP code can use this kind of method: form['filefield']['name'] to access the uploding file's name. By default, CuteUpload specified the file fields' name in this way: fileN(N: 0...N). User can specify the field name by setting FormFieldName and FormFieldStartIndex.
There are two type of name you can specify:
value="file": posted with a name for each file.
value="file[]": posted with a name array for all the file. File fields the server code will see go like this: file[0], file[1].... At the mean time, you can specify the FormFieldStartIndex for the start index of the array.
<param name="FormFieldName" value="file[]" />
<param name="FormFieldStartIndex" value="1" />
In this way, user can post file identification information upon uploading files.
Handling Events(VBScript)
CuteUpload fires events on every major occasion such as the beginning
and end of an upload, addition and deletion of files, sorting, errors,
etc. With the help of VBScript, your web page can handle some or all of
the events. The following example replaces the default Reply from Server
message by handling the CuteCtrl_UploadFinish event:
<SCRIPT LANGUAGE="VBScript">
Sub CuteCtrl_UploadFinish()
MsgBox("upload finish")
End Sub
</SCRIPT><HTML>
<BODY>
<OBJECT WIDTH=500
HEIGHT=200
ID="UploadUpload-Free"
CLASSID="CLSID:8036B0D5-7572-443c-ACA0-620FBCC3F718" CODEBASE="CuteUpload-Free.cab">
<PARAM NAME="ViewServerReply"
VALUE="False">
<PARAM NAME="Server"
VALUE="localhost">
<PARAM NAME="Script"
VALUE="/cuteupload/uploadscript.asp">
</OBJECT>
</BODY>
</HTML> |
Another example of using CuteUpload events can be found in the sample file
Progress.htm.
It demonstrates how to build a custom DHTML-based progress bar by
tapping into the CuteCtrl_UploadProgress and CuteCtrl_WaitingForReply
events.
For the complete list of events supported by CuteUpload, see Object
Reference below.
Handling Events(JavaScript)
You can also handle CuteUpload's event via javascript.
<SCRIPT type="text/javascript">
function CuteCtrl_ItemSelected(filename)
{
alert("you have choose the file: " + filename )
}
</SCRIPT>
<HTML>
<BODY>
<OBJECT WIDTH=500 HEIGHT=200
ID="UploadUpload-Free" CLASSID="CLSID:8036B0D5-7572-443c-ACA0-620FBCC3F718" CODEBASE="CuteUpload-Free.cab">
<PARAM NAME="ViewServerReply" VALUE="False" />
<PARAM NAME="Server" VALUE="localhost" / >
<PARAM NAME="Script" VALUE="/cuteupload/uploadscript.asp" / >
</OBJECT>
<!-- define the event operation of the control using javascript -->
<!-- ServerReply event -->
<SCRIPT LANGUAGE=javascript FOR=CuteCtrl EVENT="ItemSelected(filename)">
<!--
CuteCtrl_ItemSelected(filename)
//-->
</SCRIPT>
</BODY>
</HTML> |
Object Reference
CuteUpload Properties
| Property Name |
Type (Access, Default value) |
Comments |
| Server |
String (RW) |
Specifies the address of the server where the files are uploaded to. |
| Script |
String (RW) |
Specifies the upload script on the Server. |
| EnableSSL |
Boolean (RW, False) |
Specifies whether the server expects a SSL connection. |
| Port |
Integer (RW, 80) |
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. |
| Username |
String (RW) |
Specifies the default username in case basic authentication is enabled
on the server. |
| Password |
String (RW) |
Specifies the default password in case basic authentication is enabled
on the server. |
| ShowProgress |
Boolean (RW, True) |
Specifies whether the progress bar should be displayed. |
| EnablePopupMenu |
Boolean (RW, True) |
Specifies whether a popup menu should be displayed if the control is right-clicked. If an application chooses to set this property to False, it must provide some other means to invoke the Select, Remove and Upload commands. |
| ViewServerReply |
Boolean (RW, True) |
Specifies whether CuteUpload should display the Reply from Server message
box with the text returned by the upload script. |
| DefaultFolder |
String (RW) |
Specifies the default directory for the Select Files and Select Folder
dialogs. |
| AutoCloseDialog |
Boolean (RW, True) |
Specifies whether the progress dialog should be closed automatically when upload finishes. |
| FileList |
Files Collection (R) |
Returns a collection of File objects. Each object represents a file on the control's list. The File object supports the following read-only properties: Path, Size, Index (0-based) and Selected (indicates whether the file is highlighted in the list.) |
| FileFilter |
String (RW) |
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. For example,
"Images (.gif;.jpg)|*.gif;*.jpg|Documents (.doc)|*.doc" |
| ShowErrors |
Boolean (RW, True) |
Specifies whether CuteUpload 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. |
| MaxFileCount |
Long (RW, 0) |
Specifies the maximum allowed number of files. A zero value indicates
no limits. |
| MaxFileSize |
Long (RW, 0) |
Specifies the maximum allowed size of individual files. A zero value
indicates no limits. |
| MaxTotalSize |
Long (RW, 0) |
Specifies the maximum allowed total size of files. A zero value indicates
no limits. |
| Extensions |
String (RW) |
Specifies a comma-separated list of allowed file extensions. An empty
string indicates no limitations. |
| TotalFileSize |
Long (R) |
Returns the total size of selected files. |
| FileCount |
Long (R) |
Returns the number of selected files |
| ServerReply |
String (R) |
Returns a reply from server once an upload is complete. |
| FormName |
String (RW) |
Specifies the HTML form name hosted on the same page. CuteUpload will
automatically scan this form and upload all non-file items from it along
with files. |
| EnableRedirect |
Boolean (RW, False) |
Specifies whether CuteUpload should redirect the browser to the URL specified
by RedirectURL upon the completion of an upload. Only effective
when CuteUpload is hosted by IE, but not VB. If Redirect is True, CuteUpload
will REDIRECT to the specified URL |
| RedirectURL |
String (RW) |
Specifies the redirect URL after finish upload |
| Version |
String (R) |
Returns a string representing the current version of this control, for example
"2.1.0.0". |
| ConfirmRemoveAll |
Boolean (RW, True) |
Specifies whether a confirmation dialog box should be shown by CuteUpload before remove all operation to allow cancel. |
| ShowDefaultMessage |
Boolean(RW, True) |
The default message will be shown by default, no default message will be shown if it's set to false |
| CheckForm |
Boolean(RW, False) |
If CheckForm is set to True, will fire form onsubmit event before the upload action. The onsubmit event needs to return False, and the upload action need to be invoked in Javascript. |
| LicenseKey |
String(RW) |
LicenseKey property is mandatory if your server domain name is not localhost or 127.0.0.1; LicenseKey will be emailed to you when you download free edition or make purchase of commerical edition through CuteUpload website. |
| SourceN |
String(W) |
Populate the initial files to be uploaded. |
| FormFieldName |
String(W) |
Specify the form field name upon the file uploading. There are two kind of value you can use: "file" - specify a name for each uploading file; "file[]" - specify a name array for all the uploading files. |
| FormFieldStartIndex |
Short Integer(W) |
If the FormFieldName field specify a name array for uploading, you can specify the start index of the array. |
CuteUpload Methods
| Method Name |
Arguments |
Comments |
| Upload |
N/A |
Has the same effect as choosing "Upload" from the popup menu. Causes
the upload process to begin. |
| SelectFiles |
N/A |
Has the same effect as choosing "Select" from the popup menu. Causes
the Select Files dialog to come up.
This method must not be called if CuteUpload is used as a server component. |
| SelectFolder |
N/A |
Has the same effect as choosing "Select Folder" from the popup menu.
Causes the Select Folder dialog to come up.
This method must not be called if CuteUpload is used as a server component. |
| RemoveFile |
Index As Integer |
Removes a file with the zero-based index specified by
Index
from the file list.
This method must not be called if CuteUpload is used as a server component. |
| RemoveAll |
N/A |
Invokes the Remove All command. Clears the file list. |
| AddFile |
Path As String |
Adds a new file to the file list. |
| AddFolder |
Path 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 sub-folders recursively. |
| DisplayProperties |
N/A |
Causes the CuteUpload property sheet to come up.
This method must not be called if CuteUpload is used as a server component. |
| Stop |
N/A |
Programmatically stops an upload. Calling this method is equivalent
to pressing the Stop button on the progress bar. |
| RemoveSelected |
N/A |
Has the same effect as choosing "Remove" from the popup menu. Causes all highlighted items on the file list to be removed. |
| AddFormItem |
Name As String
Value As String |
Populate a user defined form item to the cuteupload control by using client-side script code. |
| RemoveFormItem |
Name As String |
Remove a specified user defined form item from the cuteupload control which is added to the control by using AddFormItem method. |
| RemoveFormItems |
N/A |
Clear the user defined form items list, in which all the files added by using AddFormItem will be clear. |
CuteUpload Events
| Name |
Arguments |
Comments |
| Sort |
Column As Integer |
Fired when the file list is sorted. If Column is 0 the sorting
is by File name, otherwise the sorting is by size. |
| AddFiles |
Number As Integer,
Size As Long |
Fires when files are added to the file list. Number specifies
the number of files being added, Size specifies total size. |
| RemoveFiles |
Number As Integer,
Size As Long |
Fires when files are removed from the file list. Number specifies
the number of files being removed, Size specifies total size. |
| UploadStart |
N/A |
Fires when the upload process starts. |
| UploadFinish |
N/A |
Fires when the upload process ends, but before a reply from the server
is received. |
| UploadProgress |
FilePercent As Integer,
OverallPercent As Integer |
Fires to indicate the upload 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. |
| WaitingForReply |
N/A |
Fires right after all files are uploaded but before a reply from the
server is received. |
| UploadFile |
FileName As String |
Fires right after a file is opened to be uploaded. FileName
specifies the file's full path. |
| ServerReply |
Reply As String |
Fires when a reply is received from the server. Reply specifies
the text received. |
| Error |
Code As Long,
Description As String |
Fires when an error occurs. Code can be one of the following
values:
1 - Max files count is reached for free version
2 - Max files size is reached
3 - Total files size is reached
4 - File extension error
5 - File can not open.
6 - Duplicate file
7 - Did not set server property
7 - Did not set script property
7 - Did not find server script
8 - Max files count is reached
-1 - Unknown error
101 - Open session failed
102 - Open connection failed
103 - No Internet connection
104 - Open request failed
105 - Add HTTP header failed
106 - Send request failed
107 - End request failed
108 - Response failed |
Common WinInet Errors and Trouble-shooting
Error: 12029
Meaning: "Cannot connect."
Solution: Make sure the Server and Script parameters are correct and
the network connection is functioning.
Error: 12030
Meaning: "Connection Aborted."
Solution: This error usually means that CuteUpload's SSL parameter does
match the SSL settings of the server. Check whether the server requires
an SSL connection, and if so set the SSL property to True. This error may
also mean that the specified script cannot be found on the server.
Where to Get Help
For more information on CuteUpload, including
licensing, please visit the web site www.cuteupload.com.
For general and sales info, please write to info@cuteupload.com.
For technical support, please write to support@cuteupload.com.
|