FtpDLX GetFile needs LocalPath (wodSFTP / wodSFTP.NET / wodSFTPdll)
I am using code with the demo library that looks like the following.
[code]
FtpDLX Ftp1 = new FtpDLX();
...
MemoryStream ms = new MemoryStream(20 * 1024);
Ftp1.LocalPath= . ;
Ftp1.GetFile(ms, var);
[/code]
The above code should not require a local path given
that it is writing to memory.
However if the LocalPath is not set than an exception
is thrown saying that the LocalPath must be set.
I want to verify that it is not writing to the file system
even temporarily.
Re: FtpDLX GetFile needs LocalPath
JSchell,
what exactly does RemotePath argument 'var' point to? What is its value?
Kreso
Re: FtpDLX GetFile needs LocalPath
It is set - I printed it via code. It looks like ./xxx/ where that represents a valid location on the remote machine.
Re: FtpDLX GetFile needs LocalPath
Valid location that points to a remote file, or a remote folder?
If you don't specify filename, only a folder, perhaps that causes trouble?
From your ./xxx/ it looks to me like it's a folder, rigth?
BTW make sure you don't use relative paths ./...., make sure it's absolute /home/joe/xxx
Reason exception was thrown is because component was unable to determine filename of the file to open - because remote path was specified without a filename, and that filename couldn't be resolved from local path too - since stream was used..
You cannot open and read remote folder, if you know what I tried to say.
Kreso
Re: FtpDLX GetFile needs LocalPath
Reason exception was thrown is because component was unable
to determine filename of the file to open - because remote
path was specified without a filename, and that filename
couldn't be resolved from local path too - since stream was used..
That doesn't seem likely. If I set the LocalPath to a value
that has does not exist on either the local or remote
machine the code still works.
Re: FtpDLX GetFile needs LocalPath
No, you don't understand what I'm trying to say.
If I do this:
ftp1.GetFile( myfile , / )
then it will work, component will be smart enough to determine to download /myfile from remote side since 'myfile' was filename specified in the line. But,
If I do this:
MS = new MemoryStream
ftp1.GetFile(MS, / )
which file should be downloaded?? That's what you're doing, right? You specified
ftp1.GetFile(MS, ./xxx/ )
so where is filename specified that is to be opened on remote server? You only specified folders. I can't download /xxx/ if that folder, give me exact file inside that folder.
Kreso
If
Re: FtpDLX GetFile needs LocalPath
I should have specified that more clearly in the example.
It looks like this - I printed it to be sure
Ftp1.GetFile(ms, ./xxx/filename );
Re: FtpDLX GetFile needs LocalPath
Ok, I think I was able to duplicate this problem. It is now fixed - can you please download wodFtpDLX.NET again and try it out?
Make sure Version property returns 1.1.0.25
Let me know how it goes!
Kreso
Re: FtpDLX GetFile needs LocalPath
It now works.