Skip to content

Commit d0afc5a

Browse files
authored
Merge pull request #18 from Dynamsoft/rebecca - directory structure updated
Rebecca - directory structure updated
2 parents db33f42 + b6c057c commit d0afc5a

19 files changed

+562
-4
lines changed

_config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
repositoryUrl: https://github.com/Dynamsoft/web-twain-docs/blob/master
22
firstLevelUrl: /web-twain/docs
3+
repository: Dynamsoft/web-twain-docs
34
docFullPath: https://www.dynamsoft.com/web-twain/docs
45
productUrl: https://www.dynamsoft.com/Products/WebTWAIN_Overview.aspx
56
productName: Dynamic Web TWAIN

_includes/sidelist-indepth/troubleshooting.html

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,27 @@
22
<ul>
33
{%- if page.url contains '/indepth/troubleshooting/' -%}
44
<li><a href="{{ site.indepth }}troubleshooting/debug.html" class="otherLinkColour">How to Debug</a></li>
5-
<li><a href="{{ site.indepth }}troubleshooting/Handle-Errors.html" class="otherLinkColour">Handle Errors</a></li>
5+
<li><a href="{{ site.indepth }}troubleshooting/license-errors/index.html" class="otherLinkColour">License Errors</a>
6+
<ul>
7+
<li><a href="{{ site.indepth }}troubleshooting/license-errors/invalid-key.html" class="otherLinkColour">Invalid License</a></li>
8+
<li><a href="{{ site.indepth }}troubleshooting/license-errors/Domain-does-not-match.html" class="otherLinkColour">Domain Doesn't Match</a></li>
9+
<li><a href="{{ site.indepth }}troubleshooting/license-errors/key-expired.html" class="otherLinkColour">License Expired</a></li>
10+
<li><a href="{{ site.indepth }}troubleshooting/license-errors/OCR-lic-exceeded.html" class="otherLinkColour">OCR License Exceeded</a></li>
11+
</ul>
12+
</li>
13+
<li><a href="{{ site.indepth }}troubleshooting/common-errors/index.html" class="otherLinkColour">Common Errors</a>
14+
<ul>
15+
<li><a href="{{ site.indepth }}troubleshooting/common-errors/general-failure.html" class="otherLinkColour">General failure</a></li>
16+
<li><a href="{{ site.indepth }}troubleshooting/common-errors/connection-couldn't-be-established.html" class="otherLinkColour">Connection Couldn't Be Established</a></li>
17+
<li><a href="{{ site.indepth }}troubleshooting/common-errors/HTTP-process-error.html" class="otherLinkColour">HTTP Process Error</a></li>
18+
<li><a href="{{ site.indepth }}troubleshooting/common-errors/HTTP-request-error.html" class="otherLinkColour">HTTP Request Error</a></li>
19+
<li><a href="{{ site.indepth }}troubleshooting/common-errors/JPEG-compression.html" class="otherLinkColour">JPEG Compression</a></li>
20+
<li><a href="{{ site.indepth }}troubleshooting/common-errors/XMLHttpRequest-cannot-load.html" class="otherLinkColour">XMLHttpRequest Cannot Load</a></li>
21+
<li><a href="{{ site.indepth }}troubleshooting/common-errors/source-connected-to-maximum.html" class="otherLinkColour">Source Connected To Maximum</a></li>
22+
<li><a href="{{ site.indepth }}troubleshooting/common-errors/sequence-error.html" class="otherLinkColour">Sequence Error</a></li>
23+
<li><a href="{{ site.indepth }}troubleshooting/common-errors/dwt-md5-is-not-allowed.html" class="otherLinkColour">dwt-md5 Is Not Allowed</a></li>
24+
</ul>
25+
</li>
626
{%- endif -%}
727
</ul>
828
</li>
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
---
2+
layout: default-layout
3+
needAutoGenerateSidebar: true
4+
title: Dynamic Web TWAIN Troubleshooting HTTP Process Error
5+
keywords: Dynamic Web TWAIN, Documentation, Troubleshooting, Common Errors, HTTP Process Error
6+
breadcrumbText: HTTP Process Error
7+
description: Dynamic Web TWAIN SDK Documentation Troubleshooting Common Errors HTTP Process Error Page
8+
---
9+
10+
11+
# Handling Errors
12+
13+
## HTTP process error
14+
15+
* Symptom
16+
17+
When you upload images using any of the HTTPUploadThroughPost*** methods, you may receive the error.
18+
19+
* Cause
20+
+ The write permission is not granted to the specified directory on the web server.
21+
+ The action page is incorrect or returns something from the web server.
22+
+ The port specified for uploading is the incorrect one.
23+
+ The size of the images you are trying to upload is beyond the maximum allowed size set by the server.
24+
25+
* Solution
26+
+ Make sure the users who are uploading have permission to write images to the specified directory on the web server. (For example, give "Write" permission to the Authenticated Users.)
27+
+ Check the response string returned from the HTTP server to figure out the cause of the process error. You can get this string by using the [HTTPPostResponseString]({{site.info}}api/WebTwain_IO.html#httppostresponsestring) property.
28+
+ Set the port to the correct one using [HTTPPort]({{site.info}}api/WebTwain_IO.html#httpport). We recommend you get the Port and Server values this way:
29+
30+
``` javascript
31+
var strHTTPServer = location.hostname;
32+
DWObject.HTTPPort = location.port == "" ? 80 : location.port;
33+
```
34+
+ If you have set [IfSSL]({{site.info}}api/WebTwain_IO.html#ifssl) to true, you must set a secure port for the HTTPPort property. For example,
35+
36+
``` javascript
37+
DWObject.IfSSL = true;
38+
DWObject.HTTPPort = 443;
39+
```
40+
> For example: If the URL for the scan page is "http://localhost:3253/....", you should set the port to 3253.
41+
42+
* Checking the server-side configuration is also useful in this scenario
43+
+ Please reset the maximum transferable data size. If you are using `ASP.NET` , you can change the value in the following line in the `Web.Config` file.
44+
45+
``` xml
46+
<httpRuntime maxRequestLength="1000000"/> // In kilobytes
47+
```
48+
49+
This line may also be required
50+
51+
``` xml
52+
<requestLimits maxAllowedContentLength="300000000" /> // In bytes
53+
```
54+
55+
The following is an example config file
56+
57+
``` xml
58+
<?xml version="1.0" encoding="UTF-8"?>
59+
<configuration>
60+
<system.web>
61+
<httpRuntime executionTimeout="3000" maxRequestLength="102400"/>
62+
<compilation debug="true" />
63+
</system.web>
64+
<system.webServer>
65+
<security>
66+
<requestFiltering>
67+
<requestLimits maxAllowedContentLength="300000000" />
68+
</requestFiltering>
69+
</security>
70+
</system.webServer>
71+
</configuration>
72+
```
73+
74+
If you are using `PHP` , you can change the value in the following line in the `php.ini` file:
75+
76+
``` shell
77+
upload_max_filesize = 2M
78+
```
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
layout: default-layout
3+
needAutoGenerateSidebar: true
4+
title: Dynamic Web TWAIN Troubleshooting HTTP Request Error
5+
keywords: Dynamic Web TWAIN, Documentation, Troubleshooting, Common Errors, HTTP Request Error
6+
breadcrumbText: HTTP Request Error
7+
description: Dynamic Web TWAIN SDK Documentation Troubleshooting Common Errors HTTP Request Error Page
8+
---
9+
10+
# Handling Errors
11+
12+
## HTTP request error
13+
14+
* Symptom
15+
16+
When you upload images via HTTP Put, you may get this error.
17+
18+
* Cause
19+
+ The problem may occur if the write permission is not provided on the server.
20+
+ If you use Tomcat, because the value of the `readonly` property is `false` by default, the HTTP Put operation is not allowed.
21+
22+
* Solution
23+
+ Check the write permission at the server.
24+
25+
- Start Internet Information Services (IIS).
26+
- Click Web Sites.
27+
- Right-click the specified work folder, select Properties.
28+
- Select the Write option at the Directory tab.
29+
30+
+ If you are using Tomcat, the `doPut()` will check to see if the `readonly` property has been changed to `false`. If it has not, the HTTP Put operation is not allowed. Please go to {Tomcat installation directory} -> conf -> web.xml, find the default servlet configuration (org.apache.catalina.servlets. DefaultServlet) and change the `readonly` property to `true` .
31+
32+
``` xml
33+
<init-param>
34+
<param-name>readonly</param-name>
35+
<param-value>false</param-value>
36+
</init-param>
37+
```
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
layout: default-layout
3+
needAutoGenerateSidebar: true
4+
title: Dynamic Web TWAIN Troubleshooting Only 24-bit True Color bmp And 8-bit gray-scaled Image Are Supported For JPEG Compression
5+
keywords: Dynamic Web TWAIN, Documentation, Troubleshooting, Common Errors, JPEG Compression
6+
breadcrumbText: JPEG Compression
7+
description: Dynamic Web TWAIN SDK Documentation Troubleshooting Common Errors JPEG Compression Page
8+
---
9+
10+
# Handling Errors
11+
12+
## Only 24-bit true color bmp and 8-bit gray-scaled image are supported for JPEG compression
13+
14+
* Symptom
15+
16+
When you save or upload an image as a JPEG file, you may receive the error.
17+
18+
* Cause
19+
20+
You are saving a Black&White image as a JPEG file but JPEG standard only allows the compression of grayscale and RGB images.
21+
22+
* Resolution
23+
24+
Make sure the pixel type of the image in the buffer is Gray or RGB. If it is not, you can either save it in another format or convert the image to grayscale using the method [ConvertToGrayScale()]({{site.info}}api/WebTwain_Edit.html#converttograyscale).
25+
26+
``` javascript
27+
if ( /*If save in JPEG*/ ) {
28+
29+
//Check whether the current image is B&W
30+
//1 is B&W, 8 is Gray, 24 is RGB
31+
if (DWObject.GetImageBitDepth(DWObject.CurrentImageIndexInBuffer) == 1)
32+
//If so, convert the image to Gray
33+
DWObject.ConvertToGrayScale(DWObject.CurrentImageIndexInBuffer);
34+
//Save image in JPEG
35+
DWObject.SaveAsJPEG("DynamicWebTWAIN.jpg", DWObject.CurrentImageIndexInBuffer);
36+
37+
}
38+
```
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
layout: default-layout
3+
needAutoGenerateSidebar: true
4+
title: Dynamic Web TWAIN Troubleshooting XMLHttpRequest Cannot Load XXX
5+
keywords: Dynamic Web TWAIN, Documentation, Troubleshooting, Common Errors, XMLHttpRequest Cannot Load XXX
6+
breadcrumbText: XMLHttpRequest Cannot Load
7+
description: Dynamic Web TWAIN SDK Documentation Troubleshooting Common Errors XMLHttpRequest Cannot Load XXX
8+
---
9+
10+
# Handling Errors
11+
12+
## XMLHttpRequest cannot load XXX
13+
14+
* Symptom
15+
16+
You get the error
17+
18+
``` shell
19+
XMLHttpRequest cannot load xxxxx. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://xxxxxxx' is therefore not allowed access.
20+
```
21+
22+
* Cause
23+
24+
You are uploading or downloading to/from a web server which is in a different domain than your current website and that web server doesn't allow accessing from a different domain.
25+
26+
* Solution
27+
28+
Try uploading to the same domain or update the server side configuration to allow cross domain requests. If you are using IIS, you can refer to the following configuration.
29+
30+
``` xml
31+
<system.webServer>
32+
<httpProtocol>
33+
<customHeaders>
34+
<add name="Access-Control-Allow-Origin" value="*" />
35+
<add name="Access-Control-Allow-Methods" value="OPTIONS, POST, GET, PUT" />
36+
<add name="Access-Control-Allow-Headers" value="x-requested-with" />
37+
<add name="Access-Control-Allow-Credentials" value="true" />
38+
</customHeaders>
39+
</httpProtocol>
40+
</system.webServer>
41+
```
42+
43+
> Note
44+
>
45+
> After updating the server configuration file, you'll need to restart the server (i.e. IIS).
46+
>
47+
> If you are downloading a file, you might need to clear the 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.
48+
>
49+
> 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, open the JS file, find `withCredentials:false` and change it to `withCredentials:true` .
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
layout: default-layout
3+
needAutoGenerateSidebar: true
4+
title: Dynamic Web TWAIN Troubleshooting A Connection With The Server Could Not Be Established
5+
keywords: Dynamic Web TWAIN, Documentation, Troubleshooting, Common Errors, Connection Couldn't Be Established
6+
breadcrumbText: Connection Couldn't Be Established
7+
description: Dynamic Web TWAIN SDK Documentation Troubleshooting Common Errors Connection Couldn't Be Established Page
8+
---
9+
10+
# Handling Errors
11+
12+
## A connection with the server could not be established
13+
14+
* Symptom
15+
16+
When you upload images to your web server, you may receive the error message.
17+
18+
* Cause
19+
20+
The problem may occur when a connection with the server is not available.
21+
22+
* Resolution
23+
+ Check if the HTTP port you set in your code coincides with the port number you set on your web server. You can use the [HTTPPort]({{site.info}}api/WebTwain_IO.html#httpport) property to set the port number.
24+
+ Make sure the address of the server is available. To check this, you can ping the address from a client machine.
25+
26+
> Note:
27+
> Both the machine name and the IP address of the server can be used for the HTTPUpload method.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
layout: default-layout
3+
needAutoGenerateSidebar: true
4+
title: Dynamic Web TWAIN Troubleshooting Request Header Field dwt-md5 Is Not Allowed By Access-Control-Allow-Headers In Preflight Response
5+
keywords: Dynamic Web TWAIN, Documentation, Troubleshooting, Common Errors, dwt-md5 Is Not Allowed
6+
breadcrumbText: dwt-md5 Is Not Allowed
7+
description: Dynamic Web TWAIN SDK Documentation Troubleshooting Common Errors dwt-md5 Is Not Allowed Page
8+
---
9+
10+
# Handling Errors
11+
12+
## Request header field dwt-md5 is not allowed by Access-Control-Allow-Headers in preflight response
13+
14+
* Symptom
15+
16+
When you fail to upload images, you may get this error
17+
18+
* Cause
19+
20+
`dwt-md5` is a default built-in header in `DWT` . It is used for each uploading process to test the integrity of data. Since this is not a standard header, the browser will send an OPTIONS preflight request before the original request is sent to verify that this header is allowed. If not, the browser will return the above error.
21+
22+
* Solution
23+
24+
Update your server-side configuration file as per your environment. If you are using IIS, you can refer to the following configuration.
25+
26+
``` xml
27+
<system.webServer>
28+
<httpProtocol>
29+
<customHeaders>
30+
<add name="Access-Control-Allow-Origin" value="*" />
31+
<add name="Access-Control-Allow-Methods" value="OPTIONS, POST, GET, PUT" />
32+
<add name="Access-Control-Allow-Headers" value="x-requested-with, dwt-md5" />
33+
<add name="Access-Control-Allow-Credentials" value="true" />
34+
</customHeaders>
35+
</httpProtocol>
36+
</system.webServer>
37+
```
38+
39+
> Note
40+
>
41+
> After updating the server configuration file, you'll need to restart the server (i.e. IIS).
42+
43+
Check out more info [here](https://fetch.spec.whatwg.org/#http-cors-protocol)
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
layout: default-layout
3+
needAutoGenerateSidebar: true
4+
title: Dynamic Web TWAIN Troubleshooting General Failure
5+
keywords: Dynamic Web TWAIN, Documentation, Troubleshooting, Common Errors, General Failure
6+
breadcrumbText: General Failure
7+
description: Dynamic Web TWAIN SDK Documentation Troubleshooting Common Errors General Failure Page
8+
---
9+
10+
# Handling Errors
11+
12+
## General failure
13+
14+
* Symptom
15+
16+
When you try scanning an image with Dynamic Web TWAIN, you may receive the error message "General failure" in the ErrorString property.
17+
18+
* Cause
19+
20+
The problem occurs when the source (scanner) is *not* disabled completely after a scanning session or the source is currently unavailable.
21+
22+
* Resolution
23+
24+
You can set [IfDisableSourceAfterAcquire]({{site.info}}api/WebTwain_Acquire.html#ifdisablesourceafteracquire) to `true` . It must be set before the call to [SelectSource]({{site.info}}api/WebTwain_Acquire.html#selectsource)
25+
26+
``` javascript
27+
function AcquireImage() {
28+
DWObject.IfDisableSourceAfterAcquire = true;
29+
DWObject.SelectSource();
30+
DWObject.OpenSource();
31+
DWObject.AcquireImage();
32+
}
33+
```
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
layout: default-layout
3+
needAutoGenerateSidebar: true
4+
title: Dynamic Web TWAIN Troubleshooting Common Errors
5+
keywords: Dynamic Web TWAIN, Documentation, Troubleshooting, Common Errors
6+
breadcrumbText: Common Errors
7+
description: Dynamic Web TWAIN SDK Documentation Troubleshooting Common Errors Index Page
8+
---
9+
10+
# Common Errors
11+
12+
## [General failure]({{site.indepth}}troubleshooting/common-errors/general-failure.html)
13+
14+
## [A connection with the server could not be established]({{site.indepth}}troubleshooting/common-errors/connection-couldn't-be-established.html)
15+
16+
## [HTTP process error]({{site.indepth}}troubleshooting/common-errors/HTTP-process-error.html)
17+
18+
## [HTTP request error]({{site.indepth}}troubleshooting/common-errors/HTTP-request-error.html)
19+
20+
## [Only 24-bit true color bmp and 8-bit gray-scaled image are supported for JPEG compression]({{site.indepth}}troubleshooting/common-errors/JPEG-compression.html)
21+
22+
## [XMLHttpRequest cannot load XXX]({{site.indepth}}troubleshooting/common-errors/XMLHttpRequest-cannot-load.html)
23+
24+
## [Source is connected to the maximum supported number of applications]({{site.indepth}}troubleshooting/common-errors/source-connected-to-maximum.html)
25+
26+
## [Sequence error]({{site.indepth}}troubleshooting/common-errors/sequence-error.html)
27+
28+
## [Request header field dwt-md5 is not allowed by Access-Control-Allow-Headers in preflight response]({{site.indepth}}troubleshooting/common-errors/dwt-md5-is-not-allowed.html)
29+
30+
31+

0 commit comments

Comments
 (0)