Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: Not able to list .jpg file through winscp

User1 wrote:

I am not able to see the files under a directory from winscp but i am able to see them at OS level.They are not hidden files. Can you please help me.

This does not seem to be a WinSCP .NET assembly question. Please start new topic in an appropriate forum and make sure you include a session log file and more details.
User1

Not able to list .jpg file through winscp

Hi,

I am not able to see the files under a directory from winscp but i am able to see them at OS level.They are not hidden files. Can you please help me.
martin

Re: ListDirectory only returns directories and not files

Try session.ListDirectory(session.HomePath + "/")
Guest

Re: ListDirectory only returns directories and not files

I did try and after some digging I see why WinSCP client works one way any my program works differently.

In the WinSCP tool I specify the directory to be /HOME_SFTP_DIR/LOC_OF_FILE

When I use C# I login and I am taken to /HOME_SFTP_DIR and of course the listing is only the directory.
However, I cannot figure out the command to change directory to /LOC_OF_FILE so then I can do a listing to see if there is anything for me to download.
So, I solved my first problem which was me, but I cannot figure out how to change directories.
martin

Re: ListDirectory only returns directories and not files

So did you try, what I have proposed?
Guest

Re: ListDirectory only returns directories and not files

The customer is using VShell from Vandyke using SFTP-3/SSH-2

File transfer protocol = SFTP-3
Cryptographic protocol = SSH-2
SSH implementation = SftpSSHD_1.4.31_Comments
Encryption algorithm = aes
Compression = No
martin

Re: ListDirectory only returns directories and not files

That's probably some peculiarity of your FTP server.
Try doing session.ListDirectory(session.HomePath)
menzo

ListDirectory only returns directories and not files

If I use WinSCP GUI client, I am connected to the default directory of the SFTP server and I can see the single file it contains.

However, if I use C# and connect to the same exact server then use ListDirectory(".") I only receive the ".." and the current directory name. No matter what I try it seems I am not able to view the file.

What is the trick I am missing?