JavaPowUpload 1.0 control documentation

For more information on how to use JavaPowUpload events see How to section.

In the list below there are all available JavaPowUpload events.

JavaPowUpload object events 



onOldJreVersion event

onEventListenerRemoved event

onEventListenerInitialized event

onAppletInit event

onCheckedChanged event

onTargetPathChanged event

onAddFile event

onRemoveFile event

onDownloadStart event

onDownloadFinish event

onDownloadStopped event

onUploadStart event

onUploadFinish event

onUploadStopped event

onServerResponse event

onFileStart event

onFileProgress event

onFileFinished event

onFileStopped event

onFileUncompressStart event

onFileUncompressProgress event

onFileUncompressFinished event

onFileUncompressStopped event


onOldJreVersion

event onOldJreVersion(String current_jre_version) {}

Occurs when JavaPowUpload executes under JRE version < 1.5.0.

Parameters

String current_jre_version - Java Runtime Environment under wich JavaPowUpload was started.

Example

function JavaPowUpload_onOldJreVersion(currentVersion)
{
 alert("JavaPowUpload require JRE version > 1.5.0. Version of your JRE is:"+currentVersion) ;
}

onEventListenerRemoved

event onEventListenerRemoved() {}

Invoked when LiveConnect removed from listeners collection.

Example

function JavaPowUpload_onEventListenerRemoved()
{
alert("LiveConnect removed from listeners collection.");
}

onEventListenerInitialized

event onEventListenerInitialized() {}

Invoked when LiveConnect initialized and added to listeners collection.

Example

function JavaPowUpload_onEventListenerInitialized()
{
 alert("LiveConnect initialized and added to listeners collection.");
}

 

onAppletInit

event onAppletInit() {}

Invoked after JavaPowUpload applet initialized and ready to work.

Example

function JavaPowUpload_onAppletInit()
{
 alert("JavaPowUpload started");
}


onCheckedChanged

event onCheckedChanged(DownloadItem di, boolean newStatus) {}

Invoked after status of any item's checkbox is changed.

Parameters

DownloadItem di - Instance of source DownloadItem (UploadItem in upload mode) object.

boolean newStatus - True if checkbox checked; otherwise false.

Example

function JavaPowUpload_onCheckedChanged(downloadItem, status)
{
 alert("Changed status of file "+downloadItem.getPath()+" to "+status);
}

 

onTargetPathChanged

event onTargetPathChanged(String newPath) {}

Invoked after user selects new destination folder. Invoked only when JavaPowUpload works in download mode.

Parameters

String newPath - Destination folder selected.

Example

function JavaPowUpload_onTargetPathChanged(targetPath)
{
 alert("Target path changed to: "+targetPath);
}

onAddFile

event onAddFile(DownloadItem di) {}

Upload mode: Invoked after user adds new files.

Download mode: Invoked after files added using addFile() method.

Parameters

DownloadItem di - Instance of DownloadItem (UploadItem in upload mode) object.

Example

function JavaPowUpload_onAddFile(downloadItem)
{
 alert("Adding file: "+downloadItem.getFullPath()+" with length:"+downloadItem.getLength()+" bytes");
}


onRemoveFile

event onRemoveFile(DownloadItem di) {}

Invoked after user removes file from tree.

Parameters

DownloadItem di - Instance of DownloadItem (UploadItem in upload mode) object.

Example

function JavaPowUpload_onRemoveFile(downloadItem)
{
 alert("Remove file: "+downloadItem.getFullPath());
}


onDownloadStart

event onDownloadStart() {}

Invoked after download process started.

Example

function JavaPowUpload_onDownloadStart()
{
 alert("Starting download process");
}



onDownloadFinish

event onDownloadFinish() {}

Invoked after download process finished.

Example

function JavaPowUpload_onDownloadFinish()
{
 alert("Download process complete");
}

onDownloadStopped

event onDownloadStopped() {}

Invoked after download process stopped by user.

Example

function JavaPowUpload_onDownloadStopped()
{
 alert("Download process stopped ");
}

onUploadStart

event onUploadStart() {}

Invoked after upload process started.

Example

function JavaPowUpload_onUploadStart()
{
 alert("Starting upload process");
}



onUploadFinish

event onUploadFinish() {}

Invoked after upload process finished.

Example

function JavaPowUpload_onUploadFinish()
{
 alert("Download upload complete");
}

onUploadStopped

event onUploadStopped() {}

Invoked after upload process stopped by user.

Example

function JavaPowUpload_onUploadStopped()
{
 alert("Upload process stopped ");
}

onServerResponse

event onServerResponse(int statusCode, String response) {}

Occurs after JavaPowUpload receives HTTP response from server.

Parameters

int statusCode - HTTP code of server reply.

String response - Server reply as a string.

Example

function JavaPowUpload_onServerResponse(status, response)
{
 alert("Server response: ("+status+") "+response);
}

onFileStart

event onFileStart(DownloadItem di) {}

Invoked after download/upload process of next file started.

Parameters

DownloadItem di - Instance of source DownloadItem (UploadItem in upload mode) object.

Example

function JavaPowUpload_onFileStart(downloadItem)
{
 alert("Starting file: "+downloadItem.getFilename());
}


onFileProgress

event onFileProgress(DownloadItem di) {}

Invoked periodically during the upload/download process of individual item.

Parameter Common.ItemProgressEventTimeout used to delay occurence of this event.

Parameters

DownloadItem di - Instance of source DownloadItem (UploadItem in upload mode) object.

Example

function JavaPowUpload_onFileProgress(downloadItem)
{
 alert("File progress: file name: "+downloadItem.getFilename()+"; progress: "+JavaPowUpload.getProgressInfo().getCurrentFilePercent()+
 "% - "+JavaPowUpload.getProgressInfo().getCurrentFileBytesRead()+
 " of "+JavaPowUpload.getProgressInfo().getCurrentFileTotalSize()+" bytes proceed");
}


onFileFinished

event onFileFinished(DownloadItem di) {}

Invoked after download/upload process of individual item finished.

Parameters

DownloadItem di - Instance of source DownloadItem (UploadItem in upload mode) object.

Example

function JavaPowUpload_onFileFinished(downloadItem)
{
 alert("File complete: "+downloadItem.getFilename());
}

onFileStopped

event onFileStopped(DownloadItem di) {}

Invoked when download/upload process of individual item stopped by user.

Parameters

DownloadItem di - Instance of source DownloadItem (UploadItem in upload mode) object.

Example

function JavaPowUpload_onFileStopped(downloadItem)
{
 alert("User stop downlod/upload of file"+downloadItem.getFullPath());
}

 

onFileUncompressStart

event onFileUncompressStart(DownloadItem di, String targetPath) {}

Invoked when uncompress process of DownloadItem di started.

Parameters

DownloadItem di - Instance of source DownloadItem (UploadItem in upload mode) object.

String targetPath - Path, wich will be unpacked archive.

Example

function JavaPowUpload_onFileUncompressStart(downloadItem, targetPath)
{
 alert("Start uncompressing file "+downloadItem.getFilename()+" to "+targetPath);
}

 

onFileUncompressProgress

event onFileUncompressProgress(DownloadItem di, String fileName, String outPutFileName, long percentDone, long extractedBytes, long totalBytes) {}

Invoked after uncompress process of next entry in zip archive started.

Parameters

DownloadItem di - Instance of source DownloadItem (UploadItem in upload mode) object.

String fileName - File name of archive.

String outPutFileName - Path, where will be extracted current archive.

long percentDone - Percent completed.

long extractedBytes - Count of already extracted bytes.

long totalBytes - Total bytes to extract.

Example

function JavaPowUpload_onFileUncompressProgress(downloadItem, entryName, targetFile, percent, currentBytes, totalBytes)
{
 alert("Uncompressing archive("+downloadItem.getFilename()+"): current entry-"+entryName+", saving to file-"+targetFile+
 ", percent - "+percent+" ("+currentBytes+" of "+totalBytes+" bytes)");
}

 

onFileUncompressFinished

event onFileUncompressFinished(DownloadItem di) {}

Invoked after extract process of DownloadItem di finished.

Parameters

DownloadItem di - Instance of source DownloadItem (UploadItem in upload mode) object.

Example

function JavaPowUpload_onFileUncompressFinished(downloadItem)
{
 alert("Finish uncompressing file "+downloadItem.getFilename());
}

onFileUncompressStopped

event onFileUncompressStopped(DownloadItem di) {}

Invoked after extract process of DownloadItem di stopped by user.

Parameters

DownloadItem di - Instance of source DownloadItem (UploadItem in upload mode) object.

Example

function JavaPowUpload_onFileUncompressStopped(downloadItem)
{
 alert("Stop uncompressing file "+downloadItem.getFilename());
}