Uploading images from ADF Sanner to HTTP server issue

Discussions about GdPicture.NET usage in non managed applications built in vb6, Delphi, vfp, MFC c++ etc...
Post Reply
Muhammad
Posts: 2
Joined: Mon Jan 16, 2012 1:05 pm

Uploading images from ADF Sanner to HTTP server issue

Post by Muhammad » Mon Jan 16, 2012 7:34 pm

Hi,
I am using twain ActiveX component to acquire images from ADF scanner, I want to upload each page as a separate file throw HTTP, I tried the following code (similar to the code of the html example shipped with the component):

Code: Select all

// Acquire
    function acquireTWAINAdf(TwainSetAutoFeed, TwainSetAutoScan, TwainSetHideUI) {
        ScannerID = drpSannerList.selectedIndex
        Resolution = 50
     unlockGdPicture();
    closeDocument;
    var status;
    m_GdPictureImaging.TwainOpenDefaultSource_2(ScannerID);
    status = m_GdPictureImaging.GetStat();
    if (status == 0) {
        m_GdPictureImaging.TwainSetAutoFeed(TwainSetAutoFeed);
        m_GdPictureImaging.TwainSetAutoScan(TwainSetAutoScan);
        m_GdPictureImaging.TwainSetHideUI(TwainSetHideUI);
        m_GdPictureImaging.TwainSetResolution(Resolution);
        var ImageID;
        var imageCount = 0;
        do {
            ImageID = m_GdPictureImaging.TwainAcquireToGdPictureImage_2(0);
            if (ImageID != 0) {
                oGdViewer.DisplayFromGdPictureImage(ImageID);
//************************* Important ***************               
URL = 'http://localhost/gdScanFolder/' + ImageID +'.jpg';
 var status = m_GdPictureImaging.SaveToHTTP_2(m_NativeImage, 4, 5, URL,'m','m1');
//************************* Important ***************
                if (imageCount == 0) {
                    m_NativeImage = m_GdPictureImaging.TiffCreateMultiPageFromGdPictureImage(ImageID);
                    //end
                    alert('end');
 
                }
                else {
                    status = m_GdPictureImaging.TiffAppendPageFromGdPictureImage(m_NativeImage, ImageID);
                }
                m_GdPictureImaging.ReleaseGdPictureImage(ImageID);
            }
            else {
                status = m_GdPictureImaging.GetStat();
            }
            imageCount++;
        }
        while (m_GdPictureImaging.TwainGetState() > 5/*TWAIN_SOURCE_ENABLED*/ && status == 0);
        if (status != 0) { //report latest error
            alert("error occured during acquisition. status: " + status);
        }
        if (m_NativeImage != 0) {
            oGdViewer.DisplayFromGdPictureImage(m_NativeImage);
            onDocumentLoaded();
        }
    }
    else {
        alert("error openning TWAIN source. status: " + status);
    }
}
The statement
var status = m_GdPictureImaging.SaveToHTTP_2(m_NativeImage, 4, 5, URL,'m','m1');
is giving me status=9 (user name=”m”, password=”m1”, windows XP,No domain)

Can you please advise me what the problem is and what is the required actions (IIS configuration, user rights).

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Uploading images from ADF Sanner to HTTP server issue

Post by Loïc » Mon Jan 16, 2012 7:41 pm

Hello,

Please try to identify which line returns a status 9.

Kind regards,

Loïc

Muhammad
Posts: 2
Joined: Mon Jan 16, 2012 1:05 pm

Re: Uploading images from ADF Sanner to HTTP server issue

Post by Muhammad » Tue Jan 17, 2012 7:35 am

hi Loïc,

The line is: var status = m_GdPictureImaging.SaveToHTTP_2(m_NativeImage, 4, 5, URL,'m','m1');

URL: 'http://localhost/gdScanFolder/' + ImageID +'.jpg';
m: user name ( a user who have full control on the physical folder of 'http://localhost/gdScanFolder')
m1 password

Best Regards,
Muhammad

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests