Downloads an image from the HTTP server into an image viewer asynchronously.

Syntax, onHttpDownloadSuccess, onHttpDownloadFailure [, onHttpDownloading]));


<string> url: specifies the URL to download the file.
<onHttpDownloadSuccess function> onHttpDownloadSuccess: callback function triggered when the file is downloaded successfully.
<onHttpDownloadFailure function> onHttpDownloadFailure: callback function triggered when the file failed to be downloaded.
<onhttpdownloading function> optional onHttpDownloading: callback function triggered during downloading image.

Please refer to the function prototype onHttpDownloadSuccess or onHttpDownloadFailure. or onHttpDownloading.

Return value



This method only supports downloading BMP, JPEG, PNG, TIFF and PDF files.

When the file fails to be loaded into the viewer, please check errorCode, errorString and httpResponse in failure callback function for more information.

Previously selected images will be deselected and the newly loaded image will be selected automatically.

When image buffer is full, that is count equals capacity, the downloaded image will not be imported into the image buffer.


/****Get image01.png from:****/
var imageviewer = DCSObject.getImageViewer ("ImageViewerContainer");  // Get a specified image viewer'', onHttpDownloadSuccess, onHttpDownloadFailure, onHttpDownloading);

function onHttpDownloadSuccess () {

function onHttpDownloadFailure (errorCode, errorString, httpResponse) {
    console.log("ErrorCode: " + errorCode+ "ErrorString: " + errorString + "HTTPResponseString: " + httpResponse);

function onHttpDownloading (percentage) {


See also


Is this page helpful?

Leave a Reply

Your email address will not be published.