EldoS | Feel safer!

Software components for data protection, secure storage and transfer

TElSimpleSFTPClient batch file download

Also by EldoS: Rethync
The cross-platform framework that simplifies synchronizing data between mobile and desktop applications and servers and cloud storages
#28401
Posted: 02/13/2014 08:59:39
by Eugene Mayevski (EldoS Corp.)

I don't think that the issue can be solved by re-instantiating the client, also this will mean a separate SSH connection for each file. But as a last resort you can try this - maybe the server can be tricked this way and it will give you complete files.


Sincerely yours
Eugene Mayevski
#28402
Posted: 02/13/2014 09:22:36
by Peder Skanning (Basic support level)
Joined: 02/26/2013
Posts: 22

Am I correct in specifying downloading a file from the SFTP Server root like this:

./2014-158_E-ARKIV.AFP
#28403
Posted: 02/13/2014 09:25:46
by Eugene Mayevski (EldoS Corp.)

Nope. The absolute path most often starts with a path separator (slash), though Windows servers sometimes also accept windows absolute paths (like C:\path\to\file.ext).

You can use RequestAbsolutePath method to convert the initial relative path (eg. your home directory) to the absolute path.


Sincerely yours
Eugene Mayevski
#28404
Posted: 02/13/2014 09:50:23
by Peder Skanning (Basic support level)
Joined: 02/26/2013
Posts: 22

I am now allmost certain, that the SFTP Server is the problem. When I build a list of files with ReadDirectory:
Code
            ArrayList aListing = new ArrayList();
            byte[] handle = _simpleClient.OpenDirectory("./");
            _simpleClient.ReadDirectory(handle, aListing);
            if (aListing.Count > 0)
            {
                foreach (object t in aListing)
                {
                    _currentFileList.Add(t);
                }
            }

i also get the filesize. This filesize, the first filesize reported in the log does not correspond with the filesize reported through On_Progress.
Also as you can se from this log, the filesize differs on three consequtive runs:
Quote
02/13/2014 16:42:05 - TSIconsole started
02/13/2014 16:42:06 - Server key received and validated OK.
02/13/2014 16:42:07 - Transfer All
02/13/2014 16:42:07 - Preparing download 5 files
02/13/2014 16:42:07 - Downloading 2014-160_E-ARKIV.AFP total size 865405
02/13/2014 16:42:07 - Downloaded 0 of 159405 bytes
02/13/2014 16:42:08 - Downloaded 8192 of 159405 bytes
02/13/2014 16:42:08 - Downloaded 16384 of 159405 bytes
02/13/2014 16:42:08 - Downloaded 24576 of 159405 bytes
02/13/2014 16:42:08 - Downloaded 32768 of 159405 bytes
02/13/2014 16:42:08 - Downloaded 40960 of 159405 bytes
02/13/2014 16:42:08 - Downloaded 49152 of 159405 bytes
02/13/2014 16:42:08 - Downloaded 57344 of 159405 bytes
02/13/2014 16:42:08 - Downloaded 65536 of 159405 bytes
02/13/2014 16:42:08 - Downloaded 73728 of 159405 bytes
02/13/2014 16:42:08 - Downloaded 81920 of 159405 bytes
02/13/2014 16:42:08 - Downloaded 90112 of 159405 bytes
02/13/2014 16:42:08 - Downloaded 98304 of 159405 bytes
02/13/2014 16:42:08 - Downloaded 106496 of 159405 bytes
02/13/2014 16:42:08 - Downloaded 114688 of 159405 bytes
02/13/2014 16:42:08 - Downloaded 122880 of 159405 bytes
02/13/2014 16:42:08 - Downloaded 131072 of 159405 bytes
02/13/2014 16:42:08 - Downloaded 139264 of 159405 bytes
02/13/2014 16:42:08 - Downloaded 147456 of 159405 bytes
02/13/2014 16:42:08 - Downloaded 155648 of 159405 bytes
02/13/2014 16:42:08 - Downloaded 159405 of 159405 bytes
02/13/2014 16:42:52 - TSIconsole started
02/13/2014 16:42:53 - Server key received and validated OK.
02/13/2014 16:42:54 - Transfer All
02/13/2014 16:42:54 - Preparing download 5 files
02/13/2014 16:42:54 - Downloading 2014-160_E-ARKIV.AFP total size 706000
02/13/2014 16:42:54 - Downloaded 0 of 173947 bytes
02/13/2014 16:42:54 - Downloaded 8192 of 173947 bytes
02/13/2014 16:42:54 - Downloaded 16384 of 173947 bytes
02/13/2014 16:42:54 - Downloaded 24576 of 173947 bytes
02/13/2014 16:42:54 - Downloaded 32768 of 173947 bytes
02/13/2014 16:42:54 - Downloaded 40960 of 173947 bytes
02/13/2014 16:42:54 - Downloaded 49152 of 173947 bytes
02/13/2014 16:42:54 - Downloaded 57344 of 173947 bytes
02/13/2014 16:42:54 - Downloaded 65536 of 173947 bytes
02/13/2014 16:42:54 - Downloaded 73728 of 173947 bytes
02/13/2014 16:42:54 - Downloaded 81920 of 173947 bytes
02/13/2014 16:42:54 - Downloaded 90112 of 173947 bytes
02/13/2014 16:42:54 - Downloaded 98304 of 173947 bytes
02/13/2014 16:42:54 - Downloaded 106496 of 173947 bytes
02/13/2014 16:42:54 - Downloaded 114688 of 173947 bytes
02/13/2014 16:42:54 - Downloaded 122880 of 173947 bytes
02/13/2014 16:42:55 - Downloaded 131072 of 173947 bytes
02/13/2014 16:42:55 - Downloaded 139264 of 173947 bytes
02/13/2014 16:42:55 - Downloaded 147456 of 173947 bytes
02/13/2014 16:42:55 - Downloaded 155648 of 173947 bytes
02/13/2014 16:42:55 - Downloaded 163840 of 173947 bytes
02/13/2014 16:42:55 - Downloaded 172032 of 173947 bytes
02/13/2014 16:42:55 - Downloaded 173947 of 173947 bytes
02/13/2014 16:43:21 - TSIconsole started
02/13/2014 16:43:22 - Server key received and validated OK.
02/13/2014 16:43:23 - Transfer All
02/13/2014 16:43:23 - Preparing download 5 files
02/13/2014 16:43:23 - Downloading 2014-160_E-ARKIV.AFP total size 532053
02/13/2014 16:43:23 - Downloaded 0 of 173947 bytes
02/13/2014 16:43:23 - Downloaded 8192 of 173947 bytes
02/13/2014 16:43:23 - Downloaded 16384 of 173947 bytes
02/13/2014 16:43:23 - Downloaded 24576 of 173947 bytes
02/13/2014 16:43:23 - Downloaded 32768 of 173947 bytes
02/13/2014 16:43:23 - Downloaded 40960 of 173947 bytes
02/13/2014 16:43:23 - Downloaded 49152 of 173947 bytes
02/13/2014 16:43:23 - Downloaded 57344 of 173947 bytes
02/13/2014 16:43:23 - Downloaded 65536 of 173947 bytes
02/13/2014 16:43:23 - Downloaded 73728 of 173947 bytes
02/13/2014 16:43:23 - Downloaded 81920 of 173947 bytes
02/13/2014 16:43:23 - Downloaded 90112 of 173947 bytes
02/13/2014 16:43:23 - Downloaded 98304 of 173947 bytes
02/13/2014 16:43:23 - Downloaded 106496 of 173947 bytes
02/13/2014 16:43:23 - Downloaded 114688 of 173947 bytes
02/13/2014 16:43:23 - Downloaded 122880 of 173947 bytes
02/13/2014 16:43:23 - Downloaded 131072 of 173947 bytes
02/13/2014 16:43:23 - Downloaded 139264 of 173947 bytes
02/13/2014 16:43:23 - Downloaded 147456 of 173947 bytes
02/13/2014 16:43:23 - Downloaded 155648 of 173947 bytes
02/13/2014 16:43:23 - Downloaded 163840 of 173947 bytes
02/13/2014 16:43:23 - Downloaded 172032 of 173947 bytes
02/13/2014 16:43:24 - Downloaded 173947 of 173947 bytes

I think I have to stop here and contact the supplyer

In a previous posting you write:
Quote
First, you are using relative path names for remote paths, which is a very bad idea, because SFTP doesn't have a concept of current directory and god knows what you are requesting when using relative paths.

The only way I can get the path to work is by starting the path with "./" The SFTP Server runs on a IBM Mainframe.
#28405
Posted: 02/13/2014 10:08:22
by Eugene Mayevski (EldoS Corp.)

Quote
Peder Skanning wrote:
The only way I can get the path to work is by starting the path with "./" The SFTP Server runs on a IBM Mainframe.


Did you try using RequestAbsolutePath method? Did it return anything meaningful?

I can imagine that mainframes' servers do things in a different ways from common system, so it's possible, for example, that they give you access only to "current" (in their understanding) directory.

Quote
Peder Skanning wrote:
i also get the filesize. This filesize, the first filesize reported in the log does not correspond with the filesize reported through On_Progress.


ListDirectory uses directory reading command. DownloadFile determines the size of the file using RequestAttributes method. What you can do is call those two methods and compare sizes. If sizes are different, then you need to complain to the server admins.


Sincerely yours
Eugene Mayevski
Also by EldoS: RawDisk
Access locked and protected files in Windows, read and write disks and partitions and more.

Reply

Statistics

Topic viewed 4595 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!