VintaSoft Twain .NET SDK Discussions

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

Board index < VintaSoft Twain < VintaSoft Twain .NET SDK Discussions

We are migrating to new forums engine, no new registration or posting currently available. TIA for your patience.

How should upload Multiple Images as BMP or JPG



How should upload Multiple Images as BMP or JPG

Post by greatbillo »

I am in middle of developing a system and using Evaluation version. What i want to know that how can I upload all images scanned at once at as a image . i can save Multipage PDF and Mutlipage TiFF and also i can upload scanned files one by one but i want to upload all images at once
string fn = new Random().Next(0, 100)+"-test.jpg";
            string fileName = Server.MapPath("~/Images/" + fn);
            Request.Files[0].SaveAs(fileName);

           fn = new Random().Next(0, 100) + "-test.jpg";
            fileName = Server.MapPath("~/Images/" + fn);
            Request.Files[1].SaveAs(fileName);
            
Request.Files[0] has no error but Request.Files[1] get an error ... it seems WCF Service send only 1 file to upload


Re: How should upload Multiple Images as BMP or JPG

Post by Alex »

Hello,

Please see our Web TWAIN Demo with Local Web Service:
https://demos.vintasoft.com/AspNetMvcTw ... calService

Demo shows how to acquire images from scanner and upload single or all images to HTTP(S) server.

Source codes of demo can be found in distributive package of VintaSoft Twain .NET SDK: "[InstallPath]\VintaSoft Twain .NET v10.2\Examples\CSharp\AspNetMvc5TwainDemos\".

Best regards, Alexander


Re: How should upload Multiple Images as BMP or JPG

Post by greatbillo »

"Upload all acquired images as multipage TIFF or PDF file "
this option is only enabled when TIFF or PDF selected and disabled for BMP and JPG. if i make it active for BMP and JPG its only upload single file

when i see the code of ImageUpload.aspx
 protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.Files.Count == 0)
            {
                return;
            }

            // save the file to the server
            string fileName = Server.MapPath("Images/demo.jpg");
            Request.Files[0].SaveAs(fileName);

            // return the path to this file
            Response.Clear();
            Response.Write("http://" + Request.Url.Authority + Request.RawUrl.Substring(0, Request.RawUrl.LastIndexOf("/")) + "/Images/demo.jpg");
            Response.Flush();
        }
    }
its only hendle Request.Files[0] and if i try to make it Request.Files[1] it gives an error


Re: How should upload Multiple Images as BMP or JPG

Post by Alex »

Hello,

Have you see the "UploadScannedImages" function in "[InstallPath]\VintaSoft Twain .NET v10.2\Examples\CSharp\AspNetMvc5TwainDemos\Views\TwainDemoWithLocalService\Index.cshtml" file? Functions shows how to upload one or several image files to HTTP server. Please see the function code and let me know if you will have any question or problem.

Best regards, Alexander


Page 1 from 1: 1