Page 1 of 1

Object doesn't support property or method 'HttpUpload_SetFileFromDisk '

Posted: Fri Jun 17, 2016 6:00 pm
by alexei
Hi,

I have used the mapping 5.2 to 6.0 topic in the help file to upgrade the JavaScript in order for it to work with the VintaSoft twain v6.0.0.1. and I'm getting this error when I use one method that supposed to be present in the Twain object. in the v5.2 the method name was: SetFileFromDisk and in v6.0.0.1 the method name became: 'HttpUpload_SetFileFromDisk

I'm getting the following error : Object doesn't support property or method 'HttpUpload_SetFileFromDisk '

Code: Select all

var ScanPath = VSTwan1.GetPathToTempDir() + ""\\"" +'"+GUID+"' + '.' + ImageFormat; // Path to store the scanned images.
VSTwan1.HttpUpload_SetFileFromDisk(scanpath) 
Does someone know why am I getting this error?

regards,

Alexei

Re: Object doesn't support property or method 'HttpUpload_SetFileFromDisk '

Posted: Sat Jun 18, 2016 10:19 am
by Alex
Hi Alexei,

ActiveX version 5.2 in one session can upload only one image file to HTTP server. For solving this problem several images can be saved into multipage TIFF or PDF file and saved file can be uploaded to HTTP server using the SetHttpFileFromDisk method.

Since version 6.0 the SetHttpFileFromDisk method is not necessary because several images can be added to HTTP request using the HttpUpload_AddFileField method.

Best regards, Alexander

Re: Object doesn't support property or method 'HttpUpload_SetFileFromDisk '

Posted: Tue Jul 12, 2016 12:07 am
by alexei
Alex.

I have a question: in order to have all the scanned images in one file in the HTTP post request, I need to maintain the same file name when using the HttpUpload_AddFileField method? The upload function has been added below.

following piece of code:

Code: Select all

function UploadToHttpServer() {
    if (VSActiveX4Scan.Error) {
    } else {   
        if (VSActiveX4Scan.HttpUpload_SetServerParams('" + PostImageUrl + "',''," + Site.ActiveXConnectionTimeout + ") == 0) { 
           alert(""Image could not be transfered to server: "" + VSActiveX4Scan.ErrorString);
        } 
        else {
            var addResult =  false;
            var imageFileName = '" + GUID + ".' + ImageFormat;
            for (var i = 0; i < VSActiveX4Scan.AcquiredImages_Count; i++){
                if(!VSActiveX4Scan.AcquiredImages_IsBlank(i, 0.01, 0)) { 
                    if (VSActiveX4Scan.AcquiredImages_Despeckle(i, " + Site.SmallNoise + ", " + Site.MediumNoise + ", " + Site.Radius + ", " + Site.BorderNoise + ") == 0) {
                        //error
                    }

                    if (VSActiveX4Scan.AcquiredImages_Deskew(i, " + Site.BorderColor + ", " + Site.ScanIntervalX + "," + Site.ScanIntervalY + ") == 0) {
                        //error
                    }

                    if (VSActiveX4Scan.AcquiredImages_DetectBorder(i, " + Site.BorderSize + ") == 0) {
                        document.getElementById('" + "').innerHTML += VSActiveX4Scan.errorString;
                    }
                    //add to multi page file
                    if (VSActiveX4Scan.HttpUpload_AddFileField('file', imageFileName, i) == 0) { 
                       alert(""Image"" + (i + 1) + ""cannot be uploaded: "" + VSActiveX4Scan.ErrorString);    
                    }
                    else {
                        addResult = true;
                    } 
                    if (!addResult) {
                        alert(""No images to upload."");
                        return;
                    }
                }
            }
            if (VSActiveX4Scan.HttpUpload_PostData() == 0) {
                    alert(VSActiveX4Scan.ErrorString);
                    return;
            }
            setTimeout('UploadStatus()',10);
        }
    }
}

thanks in advance.

Alexei

Re: Object doesn't support property or method 'HttpUpload_SetFileFromDisk '

Posted: Tue Jul 12, 2016 11:50 am
by Alex
Hello Alexei,

The HttpUpload_AddFileField method saves the specified image to an image file and adds image file to a HTTP upload form. In current version you cannot upload all scanned images as one multipage image file.

We will add the ability to upload all scanned images as one multipage image file in next version. I think this functionality will be available in 1-2 weeks.

Best regards, Alexander

Re: Object doesn't support property or method 'HttpUpload_SetFileFromDisk '

Posted: Tue Jul 12, 2016 7:26 pm
by alexei
Hi Alex,

For my case the SetHttpFileFromDisk method would have been a really great alternative pending the new functionality. In Outsystems I need all the images to be in one single pdf file and Outsystems does not have the functionality to add multiple binaries into one single file out of the box. :( :?

due to a deadline I cannot wait 1 to 2 weeks for this new functionality.

Furthermore, I have sent you a private message, but it remained in the outbox

Alexei

Re: Object doesn't support property or method 'HttpUpload_SetFileFromDisk '

Posted: Fri Jul 29, 2016 6:36 pm
by alexei
Hi Alex,

When do you guys plan to release the new version of the VintaSoft Twain ActiveX containing the ability to upload all scanned images as one multipage image file ?

Regards,

Alexei

Re: Object doesn't support property or method 'HttpUpload_SetFileFromDisk '

Posted: Thu Aug 04, 2016 4:35 pm
by Alex
Hi Alexei,

Version will be available in near time, sorry for the delay.

Best regards, Alexander