Topic review

Is it possible to change the Remote Directory without closing and reopening the session?

I'm pretty new to using WinSCP and C# programming in general.

The WinSCP .NET assembly does not have a concept of current remote working directory. You should always use full paths. Anyway, how do you set the remote directory when opening a session?

swegs

2012-11-19 15:59

Is it possible to change the Remote Directory without closing and reopening the session?

I'm pretty new to using WinSCP and C# programming in general.

martin

Re: FTP file download, .NET C#

2012-11-01

a.ilic wrote:

Does anyone have permanent solution for the topic problem? I have the same problem. I can't download the file requesting through full path, but if I set remote directory first and then request the file, download finishes successfully.

FTP file download, .NET C#

2012-10-31 20:46

Does anyone have permanent solution for the topic problem? I have the same problem. I can't download the file requesting through full path, but if I set remote directory first and then request the file, download finishes successfully.

The solution you refer to does not make any sense to me.
Please attach a log file.

nicis

2012-10-01 21:39

sorry if I did not created a new thread but It is related to this message since the initial problem I get was the file attributes error

and since the solution was to use AddRawSettings to set the directory ...

that meams also that if I want to check file attributes while working on differents directories, I have to close the session and open it again ?

martin

2012-10-01

nicis wrote:

does the problem could be solved ?
I use the temporary solution (AddRawSettings("RemoteDirectory") but this solution does not permit to "reset" the remote directory parameter(I get a dictonnary error, element already exist)
1) does the raw setting is used when the session is open or at every "command"
2) can the raw setting can be modified ?
3) does a solution exist in .net&com interface to navigate from one directory to another one (like "cd remotedirectory")
4) does a solution exist to submit a command (like "cd ") to winscp.exe process ?

I do not see how this is related to this thread.
Anyway, the assembly does not have a concept of current remote working directory. You always need to use absolute paths for remote files. You should not rely on using paths relative to the user's home directory.

nicis

2012-09-30 15:45

hi,

does the problem could be solved ?
I use the temporary solution (AddRawSettings("RemoteDirectory") but this solution does not permit to "reset" the remote directory parameter(I get a dictonnary error, element already exist)
1) does the raw setting is used when the session is open or at every "command"
2) can the raw setting can be modified ?
3) does a solution exist in .net&com interface to navigate from one directory to another one (like "cd remotedirectory")
4) does a solution exist to submit a command (like "cd ") to winscp.exe process ?

Re: C# Session.GetFiles from ftp to Local Drive.

2012-09-06

Please set Session.SessionLogPath and attach the session log to this thread.

lynzepiper

C# Session.GetFiles from ftp to Local Drive.

2012-09-04 16:01

I'm trying to download a file from a directory on a FTP site using session.GetFiles method but I keep getting "Can't get file attributes", files does not exist. Before I attempt to download the file I use session.ListDirectory. The file is listed in the RemoteDirectoryInfo that is returned from the session.ListDirectory method. I can see the file in the WinSCP GUI so I know it exists. I have full admin rights to the FTP site. I'm using the following code. The same code works for SFTP but just wont work for FTP or FTPS. I've tried it on 3 different FTP sites, ones which I know work.

[code]
try
{

if (!session.Opened)
Connect(out sessionException, out sslCertificate);