TWAIN ActiveX/Plug-in Windows/Mac HTTP Control/SDK

HTTPDownloadEx Method

Description

Downloads an image from the HTTP server.

Support information

ActiveX Edition Plug-in Edition Mac Edition
Since V5.0 Since V5.0 Since V6.4

Syntax

Boolean ObjectName. HTTPDownloadEx(String HTTPServer, String HTTPRemoteFile, Long ImageType)

Parameters

String HTTPServer: the name of the HTTP server.

String HTTPRemoteFile: the name of the image to be downloaded. It should be the relative path of the file on the HTTP server.

Long ImageType: the image format of the file to be downloaded.

Return value

Boolean.

TRUE indicates success. FALSE indicates failure.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown.

When FALSE is returned or an exception is thrown, check ErrorCode property and ErrorString property for error information.

Remarks

Dynamic Web TWAIN processes the image format according to the value of the ImageType.

Allowed Values ImageType
0 BMP
1 JPEG
2 TIFF
3 PNG
4 PDF

HTTPRemoteFile parameter should include the HTTP directory of the file.

The image downloaded will be displayed in Dynamic Web TWAIN, just as it is acquired from a TWAIN Data Source.

See also

FTPUserName property, FTPPassword property, FTPPort property, ProxyServer property, FTPDownloadEx(), HTTPPort property, HTTPUserName property, HTTPPassword property, HTTPDownload(), HTTPUploadThroughPutEx(), HTTPUploadThroughPostEx()

Sample

A JavaScript sample is provided.

<script language="javascript" type="text/javascript">
WebTWAIN = document.getElementById("iDynamicWebTwain");//iDynamicWebTwain is the id of the Dynamic Web TWAIN on the page (An object or an embed).
  function btnHTTPDownloadEx_onclick() {
    WebTWAIN.HTTPDownloadEx("localhost", "/WebTWAIN/Images/ImageData.jpg",1);
  }
	
</script>




TWAIN ActiveX | TWAIN Plug-in | TWAIN Control | TWAIN SDK | Scanner COM
Software Configuration Management | Version Control | Source Control
Copyright © 2012 Dynamsoft Corporation. All Rights Reserved.