Topic "File Mask in remote path"

Author Message
jsp.net
[View user's profile]

Joined: 2013-05-15
Posts: 4
I am trying to use the GetFile method to retrieve specific files in a directory, but have been unsuccessful. Then tried the FileExists method and it comes back false. I know the files exists b/c when I manually connect and navigate to the directory and use the file mask, the files are there. I don't know if it's something with the file mask I am using. Again, I used this file mask on the directory manually and it shows the files I need. Any help would be much appreciated.

Example of remote path:

/remote/file/path/*_something<2013-05-10>2013-05-08
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24553
Location: Prague, Czechia
Your mask it correct. Please post a complete session log file showing the problem (set Session.SessioLogPath).

Nb, Session.FileExist (singular) does not support file masks.
_________________
Martin Prikryl
jsp.net
[View user's profile]

Joined: 2013-05-15
Posts: 4
Thanks for the advice. I went ahead and Set the SessionLogPath and did so before calling the Open method, but it throws an exception saying cannot open Log: C:\Temp\directory. Would this indicate that the connection is at fault. I have it to where a user logs in and their username and password and other connection options are stored in a session. I then reuse this session when another event(button click) occurs. This is the point that I am at so far. Sorry, hope this makes sense, I am a little new to programming.
jsp.net
[View user's profile]

Joined: 2013-05-15
Posts: 4
Ok. I found what I was doing wrong. I needed to set the FileMask property in the TransferOption class and then pass the transfer option to the Session.GetFile method. After doing this it transferred the desired files, located by the file mask, to the appropriate local directory.
tkennedy
[View user's profile]

Joined: 2012-10-26
Posts: 11
jsp.net wrote:
Ok. I found what I was doing wrong. I needed to set the FileMask property in the TransferOption class and then pass the transfer option to the Session.GetFile method. After doing this it transferred the desired files, located by the file mask, to the appropriate local directory.


Would you be so kind as to post snippet of what you did? I've been trying to do this same thing for some time now.
jsp.net
[View user's profile]

Joined: 2013-05-15
Posts: 4
Session session = new Session();
TransferOptions transferOptions = new TransferOptions();

transferOptions.FileMask = "Your File Mask";

session.Open(Your Connection);
session.GetFiles(remotePath, localPath, false, transferOptions);
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License