The leading provider of version control solution and TWAIN SDK

How to work with SSL?

You can use the IfSSL property.

The following JavaScript Sample shows how to use IfSSL property.

<script language="javascript">

function btnUpload_onclick()
{

if (window.location.protocol != "https:"){  
frmScan.DynamicWebTwain1.HTTPPort = 80;
   frmScan.DynamicWebTwain1.IfSSL = false; // if 80 is the port number of non-secure port
}

else{
   frmScan.DynamicWebTwain1.HTTPPort = 443;
   frmScan.DynamicWebTwain1.IfSSL = true; // if 443 is the port number of secure port
   }

   frmScan.DynamicWebTwain1.HTTPUploadThroughPost("127.0.0.1", 0, "/SaveToFile.php", "imageData.jpg");

   if (frmScan.DynamicWebTwain1.ErrorCode != 0)
      alert(frmScan.DynamicWebTwain1.ErrorString);
   else //succeded
      alert("Successful");
}
</script>

Note:

Dynamic Web TWAIN Plug-in 5.1 or earlier versions didn't have full support for SSL. In Dynamic Web TWAIN Plug-in 5.2, we improved SSL support. In Dynamic Web TWAIN Plug-in 6.0, we added two methods BindSSLCert and BindSSLCertEx to relieve the users from having to select the Certificate when uploading.

References:

IfSSL  HTTPUploadThroughPost






Article Details

Last Updated
17th o January, 2012

Would you like to...

Print this page Print this page

Email this page Email this page

Post a comment Post a comment

Subscribe me

Add to favorites Add to favorites

Remove Highlighting Remove Highlighting

Edit this Article

Quick Edit

Export to PDF

User Opinions (0 votes)

No users have voted.

How would you rate this answer?



Thank you for rating this answer.

Related Articles

Attachments

No attachments were found.

Visitor Comments

No visitor comments posted. Post a comment

Post a comment

To post a comment for this article, simply complete the form below. Fields marked with an asterisk are required.
   Name:
   Email:
* Comment:
* Enter the code below:
 

Continue