Proxy Settings

Questions, comments and suggestions concerning VintaSoft Twain .NET SDK.

Moderator: Alex

Post Reply
dmitri_blinov
Posts: 5
Joined: Wed Jun 30, 2010 8:54 am

Proxy Settings

Post by dmitri_blinov »

Hello,

I'm trying to use 6.0.17.5 version of VintaSoftTwain.NET and I wonder if HttpUpload.ProxyPort and HttpUpload.ProxyHost properties are really used by HttpUpload module? The thing is I am setting the values of ProxyPort and ProxyHost to point to any nonexistent proxy and yet the image gets uploaded successfully even without any delay. Does this means that ProxyPort and ProxyHost properties are simply ignored?

(for example "10.0.46.46" in our network
ping 10.0.46.46
Pinging 10.0.46.46 with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.
)

PS. VintaSoftTwain.NET is hosted by IE 7 if that plays any difference.
Alex
Site Admin
Posts: 2303
Joined: Thu Jul 10, 2008 2:21 pm

Re: Proxy Settings

Post by Alex »

Helo Dmitri,

No, proxy settings can not be ignored. What code do you use?

Best regards, Alexander
dmitri_blinov
Posts: 5
Joined: Wed Jun 30, 2010 8:54 am

Re: Proxy Settings

Post by dmitri_blinov »

The code is actually very close to the one of in the examples. Here the code snippet for function that actually uploads the image.

function UploadToHttpServer()
{
document.CustomerDocumentImageCreate2.btnScanUpload.disabled = 1;
document.CustomerDocumentImageCreate2.btnScanRecognize.disabled = 1;

if (HttpUpload1.ProxyPort == null)
{
alert("Your .NET Framework Security settings must be configured to run the components in your browser.");
return
}

HttpUpload1.Url = httpUrl;
HttpUpload1.CookieHeader = "JSESSIONID=" + httpSessionCookie;
HttpUpload1.ProxyHost = "10.0.46.46";
HttpUpload1.ProxyPort = 8080;

var httpFileField = "CustomerDocumentImageCreate_DocumentImage";
var httpFileFieldValue = ImagePath;
HttpUpload1.AddTextField("CustomerDocumentImageCreate_action","create");
HttpUpload1.AddTextField("CustomerDocumentImageCreate_CustomerDocumentNo",CustomerDocumentNo);
HttpUpload1.AddTextField("CustomerDocumentImageCreate_CustomerNo",CustomerName);
HttpUpload1.AddTextField("CustomerDocumentImageCreate_ImageType", "image/jpeg");
var imageStream = VSTwain1.GetImageAsStream(0,1);

if (imageStream == null)
{
alert("Изображение не может быть сохранено");
return;
}

HttpUpload1.AddFileField(httpFileField,httpFileFieldValue,imageStream);

if (HttpUpload1.PostData() == 0)
{
alert("Загрузка * закончилась неуспешно: " + HttpUpload1.errorString);
document.CustomerDocumentImageCreate2.btnScanUpload.disabled = 0;
document.CustomerDocumentImageCreate2.btnScanRecognize.disabled = 0;
} else {
setTimeout("UploadStatus()",10);
}
}
dmitri_blinov
Posts: 5
Joined: Wed Jun 30, 2010 8:54 am

Re: Proxy Settings

Post by dmitri_blinov »

Alex, the problem is real show stopper for us, should I better fill in official support request ?
Post Reply