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
Upload multitiff to ftp
Moderator: Alex
Re: Upload multitiff to ftp
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:
2. Save multipage TIFF file to memory and upload it, here is a snippet of code:
Best regards, Alexander
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)
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)