Error message: XMLHttpRequest cannot load XXX

Error:

XMLHttpRequest cannot load xxxxx.
No 'Access-Control-Allow-Origin' header is present on the requested resource.
Origin 'http://xxxxxxx' is therefore not allowed access.

Cause:

Dynamic Web TWAIN supports uploading/downloading image or document to/from a web server. However, if the upload/download process goes across two (or more) domains, it will encounter the above failure.

Solution:

Please update your server side configration file as per your environment. If you are using IIS, here is the web config scripts for your reference.

If you are using Windows Authentication, you may need to change the default setting of "withCredentials" in the dynamsoft.webtwain.initiate.js file. To do that, please open the JS file and search for "withCredentials:false". Please change the value to "withCredentials:true".

Notes:

  • After updating the server configuration file, you'll need to restart the server (e.ge IIS).
  • If you are downloading a file, you might need to clear browser cache because a cached file will not be requested again from the server, thus still no 'Access-Control-Allow-Origin' header will be presented.