Dynamic Web TWAIN: How to automatically save images after scanning?

You can use Dynamic Web TWAIN events to automatically save images after scanning, without clicking another button for Save. Events OnPostTransfer Event : Fires after each scan.
OnPostAllTransfers Event: Fires after all scanning completed. Methods SaveAs*** : Save images to the local disk of the client machine
HTTPUpload***: Upload images to the web server

  Samples 1. If you want to auto save each scanned images as different files on local disk:

function DWT_AcquireImage() {
         DWObject.SelectSource();
         DWObject.OpenSource();
         DWObject.IfShowUI = false;
         DWObject.IfFeederEnabled = true;
         DWObject.IfAutoFeed = true;
         DWObject.XferCount = -1;
         DWObject.AcquireImage(); //using ADF  for scanning
        }
function DynamicWebTwain_OnPostTransfer() { //fires after each scan
         var strFileName;
         var Digital = new Date();
         var Month = Digital.getMonth() + 1;
         var Day = Digital.getDate();
         var Hour = Digital.getHours();
         var Minute = Digital.getMinutes();
         var Second = Digital.getSeconds();
         var CurrentTime = Month + "_" + Day + "_" + Hour + "_" + Minute + "_" + Second;
         strFileName = "D:/temp/"+CurrentTime + ".pdf";
         DWObject.SaveAsPDF(strFileName,DWObject.CurrentImageIndexInBuffer); //save each scanned image as a different PDF file 
         if (DWObject.ErrorCode != 0) {  
             alert (DWObject.ErrorString);
         }
     }

2. If you want to auto upload all scanned images as a multi-page TIF file, you can do it like this:

function DWT_AcquireImage() {
         DWObject.SelectSource();
         DWObject.OpenSource();
         DWObject.IfShowUI = false;
         DWObject.IfFeederEnabled = true;
         DWObject.IfAutoFeed = true;
         DWObject.XferCount = -1;
         DWObject.AcquireImage(); //using ADF  for scanning
        }
function DynamicWebTwain_OnPostAllTransfers() {
         DWObject.CloseSource();
         var strActionPage;
         var strHostIP;
         var CurrentPathName = unescape(location.pathname); // get current PathName in plain ASCII 
         var CurrentPath = CurrentPathName.substring(0, CurrentPathName.lastIndexOf("/") + 1);
         strActionPage = CurrentPath + "SaveToFile.aspx"; //the ActionPage's file path
         strHostIP = location.hostname; //the host's ip or name 
        DWObject.HTTPPort = location.port;
        WebTWAINObj.HTTPUploadAllThroughPostAsMultiPageTIFF(strHostIP,strActionPage,"imageData.tif");
        if (DWObject.ErrorCode != 0) {  //Failed to upload image
             alert(DWObject.ErrorString);
         } 
}