Page 1 of 1

Upload multitiff to ftp

Posted: Fri May 21, 2010 10:19 pm
by flealg
Hi,
I am test the product

I have my multitiff "C:\Test.tif" with two images. I make with
For i = 0 To VSTwain1.NumImages - 1
VSTwain1.SaveImage(i, saveFileDialog1.FileName)
Next

I looking for upload "C:\Test.tif" to ftp

This code only upload one image.
ftpUpload1.AddFile(ftpFileName.Text, mainForm.VSTwain1.GetImageAsStream(mainForm._currentImageIndex, ImageFileFormat.TIFF))

Thanks
Fernando

Re: Upload multitiff to ftp

Posted: Sat May 22, 2010 10:45 am
by Alex
Hello Fernando,

VSTwain.GetImageAsStream method returns the single image acquired from scanner as stream.

You can go by 2 ways if you want to upload multipage TIFF file to FTP server:
1. Save multipage TIFF file to disk and upload it, here is a snippet of code:

Code: Select all

For i = 0 To VSTwain1.NumImages - 1
    VSTwain1.SaveImage(i, saveFileDialog1.FileName)
Next

Dim fileStream As FileStream = File.Open(saveFileDialog1.FileName, FileMode.Open, FileAccess.Read)
ftpUpload1.AddFile(ftpFileName.Text, fileStream)
2. Save multipage TIFF file to memory and upload it, here is a snippet of code:

Code: Select all

Dim memoryStream As MemoryStream = VSTwain1.GetImageAsStream(0, ImageFileFormat.TIFF)
Dim i As Integer
For i = 1 To VSTwain1.NumImages - 1
    VSTwain1.SaveImageToStream(i, memoryStream, ImageFileFormat.TIFF)
Next i

ftpUpload1.AddFile(ftpFileName.Text, memoryStream)
Best regards, Alexander

Re: Upload multitiff to ftp

Posted: Tue Jun 01, 2010 4:21 pm
by flealg
Yeah!,
Now it's working. :P
http://www.captura-digital.com/images/s ... umento.png

Thanks you
Fernando