ActiveXPowUpload object methods
FileItem GetItem(index:Long)
FileItem GetItem(path:String)
Method returns a FileItem object coresponding to some item in the file list. Method allows to get item by Index or by file path.
index
A number that indicates the 0-based index of the item in the list. The value must be greater than or equal to 0 and less than ActiveXPowUpload.FileListItemCount
. You should convert index value if it has String type but stores number!
path
A full path of the needed file.
var file = ActiveXPowUpload.GetItem(0); //Get file by index;
file = ActiveXPowUpload.GetItem("c:\\file.jpg"); //Get file by its full path;
file = ActiveXPowUpload.GetItem(parseInt("0")); //Use this way to get file if index has String type
void Upload (bool wait = false)
Method starts files uploading.
There are some restrictions on when the upload method can be invoked. It is an error to start upload twice. You must always wait for the last upload to terminate before starting it again. You are not allowed to start upload inside an event handler. Here “event handler” means only a handler of the ActiveXPowUpload event like OnUploadBegin, OnUploadProgress and so on.
ActiveXPowUpload sends files in the order they appear in the file list. Each file contained within a separate part with a name "FILE<N>". Where <N> is the index of the file in the list. Index is 0-based.
wait
If 'wait' is true, the Upload method waits for upload termination.
If 'wait' is false, the Upload methods returns as soon as upload process starts.
Default value is 'false';
ActiveXPowUpload.Upload(false);
window.alert("If you see this message right away after upload starts then Upload method doesn't wait!");
void Stop()
Cancels upload. An upload process is notified to terminate. After a while the upload process notices the cancel request and cancels upload. Sometimes, though, the upload progress might complete before the notification received. In this case the upload terminates as usual. The stop methods doesn't wait for upload termination. Generally you can't start the upload immediately after the Stop method. You should wait for a while.
ActiveXPowUpload.Stop();
void ShowAddFilesDialog()
Show "Add files" dialog. Selected files will be added to the list.
ActiveXPowUpload.ShowAddFilesDialog();
void ShowAddFolderDialog()
Show "Add folder " dialog. All files of the selected folder and its subfolders will be added to the list.
ActiveXPowUpload.ShowAddFolderDialog();
void AddFormItem(name: String, value: String)
Adds a (name, value) pair to the list of text fields that will be sent as text Form items. To prevent possible name duplication the name can’t match the pattern used for naming files. It is “FILE\d+”, i.e. the “FILE” string followed by one or more digits. The name can't be empty.
See also FormItem property.
name
Name of text Form item. Must be unique. It is similar to the HTML "Name" parameter of a Form item.
value
Value of text Form item. It is similar to the HTML "Value" parameter of a Form item.
ActiveXPowUpload.AddFormItem("username", "Jdoe");
void RemoveAllFormItems()
Removes all items from the text fields list.
ActiveXPowUpload.RemoveAllFormItems();
void RemoveFormItem(name:String)
Removes text field item from the text fields list with the specified name.
name
Name of the item. It is similar to the HTML "Name" parameter of a Form item.
ActiveXPowUpload.RemoveFormItem("username");
void RemoveFile(index:Long)
Removes file list element, either file or folder.
index
A number that indicates a 0-based index of a file list element. The value must be greater than or equal to 0 and less than ActiveXPowUpload.FileListItemCount.
ActiveXPowUpload.RemoveFile(0);
void RemoveSelectedFiles()
Method removes selected (highlighted) file list items.
ActiveXPowUpload.RemoveSelectedFiles();
void RemoveAllFiles()
Method removes all file list items.
ActiveXPowUpload.RemoveAllFiles();
void Paste()
Method adds files from clipboard into the list. If the clipboard contains inappropriate data, nothing will be done. Folders are processed recursively.
ActiveXPowUpload.Paste();
String GetServerReply(codepage: Long)
Returns server reply as a string. It’s everything that server sents in response to upload. The component isn’t smart enough to detect the server reply encoding itself. You must provide the code page of the server reply.
codepage
Code page of server reply content. Use 65001 value for UTF-8 content.
window.alert(ActiveXPowUpload.GetServerReply(65001));
Long GetServerStatusCode ()
HTTP code of the server reply. 200 in most cases means success, 500 Internal error. You can find most HTTP errors with short descriptions at the w3.org website.
See also GetServerStatusText.
window.alert(ActiveXPowUpload.GetServerStatusCode());
String GetServerStatusText()
A short description of the HTTP code. For code 200 it is usually "OK". You can find most HTTP errors with short descriptions at the w3.org website.
See also GetServerStatusCode.
window.alert(ActiveXPowUpload.GetServerStatusText());
void ShowProgressWindow()
Shows upload progress window.
See also HideProgressWindow.
ActiveXPowUpload.ShowProgressWindow();
void HideProgressWindow()
Hides upload progress window.
See also ShowProgressWindow.
ActiveXPowUpload.HideProgressWindow();