|
| 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 | + ``` |
0 commit comments