Service Configuration

Starting with version 12 HTML5 edition, Dynamic Web TWAIN HTML5 Edition enables you to configure whether to allow access to webcams, scanners or local files. All settings can be configured in the DWTConfiguration.ini file, which is at C: \Windows\SysWOW64\Dynamsoft\DynamicWebtwain\ForChrome or
C: \Windows\System32\Dynamsoft\DynamicWebtwain\ForChrome

1

Let’s consider each of these configuration settings.

General Settings

LogLevel
The level on which Dynamic Web TWAIN writes its log. The default value is 6. You can set it to 14 to log more detailed information for debugging.

Port
The port number used by Dynamsoft Web TWAIN Service for http communication.

PortSSL
The port number used by Dynamsoft Web TWAIN Service for https communication.

Server
The monitored IP. By default, Dynamsoft Web TWAIN service only monitors the http(s) requests from 127.0.0.1. You can change the IP for the service to monitor. For example, “192.168.3.7”. At the same time, make sure you add the following line in the dynamsoft.webtwain.config.js file.

Dynamsoft.WebTwainEnv.ServerAddress = {“Server”: “192.168.3.7”, “Port”: 18618, “SSLPort”: 18619};
If your site is an https site, when the IP is changed, you need to change the SSL certificate as well, which is at: C: \Windows\SysWOW64\Dynamsoft\DynamicWebtwain\ForChrome\cert or
C: \Windows\System32\Dynamsoft\DynamicWebtwain\ForChrome\cert

For more information on how to change the SSL certificates, contact us at support@dynamsoft.com.

Dynamsoft Authorization

EnableScannerAccessAuth

Configure whether you want to enable scanner access authorization.

The default value is true, which means the authorization is enabled. When set to false, the authorization is turned off—allowing access to all scanners.

Here is the dialog you see when you try to scan documents from your scanner when EnableScannerAccessAuth is set to true.

2

EnableFileAccessAuth

Configure whether you want to enable file access authorization.

The default value is true, which mean the authorization is enabled. When it is set to false, the authorization is turned off and Dynamic Web TWAIN is allowed to load/save any files on your local disk.

Below is the dialog you see when you try to do one of the following things when EnableFileAccessAuth is set to true.

  1. Load files from your local machine
  2. Download files from the web server to your local machine
  3. Save files to your local machine

3

EnableWebcamAccessAuth

Configure whether you want to enable webcam access authorization.

The default value is true, which means the authorization is enabled. When it is set to false, the authorization is turned off and Dynamic Web TWAIN is allowed to access all webcams on your local machine.

Below is the dialog you see when you try to grab images from your webcams when EnableWebcamAccessAuth is set to true.

4

As you can see, there are four options in all three dialogs:

Allow Once: authorized until you refresh or reopen the browser
Always Allow: authorized for this URL – no further authorization prompt will appear
Block Once: blocked until you refresh or reopen the browser, (whereupon a new prompt will appear)
Always Block: always block this URL, (no further prompt will appear)

When you choose “Always Allow” or “Always Block”, a file named webtwain.exception will be automatically created at:

C: \Windows\SysWOW64\Dynamsoft\DynamicWebtwain\ForChrome
or
C: \Windows\System32\Dynamsoft\DynamicWebtwain\ForChrome

Once chosen, there won’t be any prompt for the same URL and same user anymore. If you want to change your mind and make a different choice, you can call Dynamsoft.WebTwainEnv.RemoveAllAuthorizations() to remove all exceptions previously added.

Please note that all choices are URL specific and user specific. That is to say, your choice for this URL (site) won’t affect your choice for another URL (site) and one user’s choice won’t affect others’, either.