JavaPowUpload 2.2
Events
  Home page
Contact support

JavaPowUpload events 

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

In the list below there are all available JavaPowUpload events.



onOldJreVersion event

onEventListenerRemoved event

onEventListenerInitialized event

onAppletInit event

onFileListLoaded event

onCheckedChanged event

onTargetPathChanged event

onAddFile event

onAddFiles event

onRemoveFile event

onDownloadStart event

onDownloadFinish event

onDownloadStopped event

onUploadStart event

onUploadFinish event

onUploadStopped event

onPrepareRequest event

onServerResponse event

onFileStart event

onFileProgress event

onFileFinished event

onFileStopped event

onFileUncompressStart event

onFileUncompressProgress event

onFileUncompressFinished event

onFileUncompressStopped event

onError event


onOldJreVersion

event onOldJreVersion(String current_jre_version) {}

Occurs when JavaPowUpload executes under JRE version < 1.5.0.

Depricated: JavaPowUpload since 1.1.1 version compiled under 1.5 JDK and cannot be run under JRE version < 1.5.0.

Parameters

String current_jre_version - Java Runtime Environment under which 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 is initialized and ready to work.

Example

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


onFileListLoaded

event onFileListLoaded() {}

Invoked after file list was successfully loaded.

Example

function JavaPowUpload_onFileListLoaded()
{
 alert("file list loaded");
}


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 the upload mode) object.

boolean newStatus - True if the checkbox is 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 a user selects a new destination folder. Invoked only when JavaPowUpload works in the download mode.

Parameters

String newPath - selected destination folder.

Example

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

onAddFile

event onAddFile(DownloadItem di) {}

Invoked for each file.

Upload mode: Invoked after a user adds new files.

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

Parameters

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

Example

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


onAddFiles

event onAddFiles(UploadItem[] files) {}

Invoked one time every time when user adds files.

Upload mode: Invoked after a user adds new files.

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

Parameters

UploadItem[] files - Array of of instances of the DownloadItem (UploadItem in upload mode) objects.

Example

	function JavaPowUpload_onAddFiles(files)
	{
		alert(files.length+" files added");
		for(var i=0; i < files.length; i++)
			alert("added file "+files[i].getFileName());
	}



onRemoveFile

event onRemoveFile(DownloadItem di) {}

Invoked after a user removes a file from the tree.

Parameters

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

Example

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


onDownloadStart

event onDownloadStart() {}

Invoked after the download process has been started.

Example

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



onDownloadFinish

event onDownloadFinish() {}

Invoked after the download process has been finished.

Example

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

onDownloadStopped

event onDownloadStopped() {}

Invoked after the download process has been stopped by a user.

Example

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

onUploadStart

event onUploadStart() {}

Invoked after the upload process has been started.

Example

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



onUploadFinish

event onUploadFinish() {}

Invoked after the upload process has been finished.

Example

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

onUploadStopped

event onUploadStopped() {}

Invoked after the upload process has been stopped by a user.

Example

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

onPrepareRequest

event onPrepareRequest(UploadItem[] files) {}

Fired in the HTTP upload mode when a request is prepared, right before the upload has been started.

Parameters

UploadItem[] files - Array of the UploadItem objects which will be posted in a request.

Example

function JavaPowUpload_onPrepareRequest(files)
{
 alert("request prepaired, starting upload");
}

onServerResponse

event onServerResponse(int statusCode, String response, UploadItem[] files) {}

Occurs after JavaPowUpload receives the HTTP response from server.

Parameters

int statusCode - HTTP code of server reply.

String response - Server reply as a string.

UploadItem[] files - Array of the UploadItem objects which will be posted in a request.

Example

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

onFileStart

event onFileStart(DownloadItem di) {}

Invoked after download/upload process of the next file is started.

Parameters

DownloadItem di - Instance of the source DownloadItem (UploadItem in the 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 an individual item.

Common.ItemProgressEventTimeout parameter is used to delay the occurrence of this event.

Parameters

DownloadItem di - Instance of the source DownloadItem (UploadItem in the 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 the download/upload process of the individual item has been finished.

Parameters

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

Example

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

onFileStopped

event onFileStopped(DownloadItem di) {}

Invoked when download/upload process of an individual item has been stopped by a user.

Parameters

DownloadItem di - Instance of the source DownloadItem (UploadItem in the 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 uncompressing process of the DownloadItem di has been started.

Parameters

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

String targetPath - Path where the archive will be unpacked.

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 uncompressing process of the next entry in the zip archive has been started.

Parameters

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

String fileName - File name of the archive.

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

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 extracting process of the DownloadItem di has been finished.

Parameters

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

Example

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

onFileUncompressStopped

event onFileUncompressStopped(DownloadItem di) {}

Invoked when the extracting process of the DownloadItem di has been stopped by a user.

Parameters

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

Example

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

onError

event onError(String errorMessage) {}

Invoked if an error occurs.

Parameters

String errorMessage - Error message from JavaPowUpload.

Example

function JavaPowUpload_onError(errorMessage)
{
 alert(errorMessage);
}