Is there a way to get the current full remote path of file in FTP2 and SFTP?
asked Feb 27 '13 at 09:32
I am at a loss for how you can be downloading a file that you don't already know the remote path for. The only way I can think of would be that you are using either the DownloadTree method, or the MGetFiles method, or the SyncLocalTree method. All of which appear to be synchronous calls, so unless your language supports callback events- you can't do much in between file downloads.
All other download methods appear to require the input of the path in order to process the download. To accomplish a multi-download equal to one of the above commands asynchronously, you could use GetCurrentRemoteDir and GetTextDirListing to decide which files need to be downloaded, and download them programmatically. The latter of the two can be parsed and each listing passed to a download method, and combining of the first with the listing tells you the path...
Conversely, if you are in a directory, and are just downloading a file (that you already know the name of) you can combine the filename with GetCurrentRemoteDir to get the full path:
As you can see: I had to make a lot of assumptions here... If this isn't the answer you were looking for, maybe you could provide some more information about what you're doing; how you're doing it; what language you're doing it in; and what you've already tried.
I hope this was helpful
answered Feb 27 '13 at 14:33