httpDownload()

Description

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

Syntax

ImageViewerObject.io.httpDownload(url);

Parameters

<string> url: specifies the URL to download the file.

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

Return value

bool

true indicates success. false indicates failure.

When false is returned, check getErrorCode() or getErrorString() for error information.

Remarks

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.

Example

/****Get image01.png from: http://www.dynamsoft.com/images/image01.png****/
var imageviewer = DCSObject.getImageViewer ("ImageViewerContainer");  // Get a specified image viewer
imageviewer.io.httpDownload('https://www.dynamsoft.com/images/image01.png');

See also

.io.httpDownloadAsync()

Is this page helpful?

Leave a Reply

Your email address will not be published.