Symptom:
When you upload images using the HTTPUploadThroughPost*** method, you may receive the following error messages:
Cause:
1. The write permission is not granted to the specified directory on the web server.
2. The action page is incorrect or returns something from Web server.
3. The Port for uploading is not right.
4. The size of the images you try to upload is beyond the maximum allowed size set on the server.
Dynamic Web TWAIN uses a special way to see if an image is uploaded and processed successfully by server. If the server returns 0 byte, indicates success. Otherwise, indicates failure. In other words, when the uploaded image is processed successfully, the action page on the server should not return anything.
Resolution:
1. Make sure the users who are uploading have the permission to write images to the specified directory on the Web Server. (For example, give "Write" permission to the Authenticated Users.)
2.Please check the response string returned from the HTTP server. The response string can help you figure out the cause of the process error. You can get this string by using the HTTPPostResponseString property. Click here for more information about the property.
3. Set the Port with the property HTTPPort. (For example: If the URL for the scan page is "http://localhost:3253/....", you need to set the port to 3253).
We recommend you get the Port and Server value this way:
strHTTPServer = location.hostname;
WebTWAIN.HTTPPort = location.port==""?80:location.port;
NOTE:
If you set the IfSSL property to true, please note you must set a secure port for HTTPPort property. For example,
WebTWAIN.IfSSL = true;
WebTWAIN.HTTPPort = 443;
4. Please reset the maximum transferable data size:
If you are using ASP:
If you are using IIS 6:
1) Start -> Run , type "cmd"
2) Go to "C:\Inetpub\AdminScripts" by typing: cd C:\Inetpub\AdminScripts
3) To view max request entity allowed:
cscript adsutil.vbs get w3svc/AspMaxRequestEntityAllowed
If you are using IIS 7:
1) Start -> Run , type "InetMgr" to open IIS 7 Manager
2) {Your WebSite}->Feature View->ASP->Limites Properties
3) Set "Maximum Requesting Entity Body Limit" to a bigger value like "1000000"
To set max request entity allowed:
cscript adsutil.vbs set w3svc/AspMaxRequestEntityAllowed 1000000 (You can change the value by yourself.)
If you are using ASP.NET, you can change the value at the following line in the "Web.Config" file.
<httpRuntime maxRequestLength="1000000"/> (You can change the value by yourself.)
If you are using ASP.NET on IIS 7, you might need to add the below line as well:
<requestLimits maxAllowedContentLength="300000000" />. For more info, please click here. Below is a simple sample:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.web>
<httpRuntime executionTimeout="3000" maxRequestLength="102400"/>
<compilation debug="true" />
</system.web>
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="300000000" />
</requestFiltering>
</security>
</system.webServer>
</configuration>
If you are using PHP, you can change the value at the following line in the php.ini file:
upload_max_filesize = 2M (You can change the value by yourself.)
Also, you can send the screenshot of the response string to twainsupport@dynamsoft.com so that we can help you pinpoint the cause of the issue.
