Topic "Could not retrieve file information"

Author Message
[View user's profile]

Joined: 2013-06-17
Posts: 1
Error retrieving a file from the Bloomberg FTP site. I am able to retieve a directory listing and check that the required files exists on the FTP site, however when retrieving the file using GetFiles I receive an error message
-- WinSCP Version 5.2.1 (Build 3231) (OS 6.1.7601 Service Pack 1)
> 2013-06-18 11:33:12.041 Script: get  -nopermissions -preservetime -transfer="binary" -- "./f4387audt.ext.130614.1" "T:\DataWarehouse\Bloomberg\AUDT\20130614_AUDT.txt"
. 2013-06-18 11:33:12.041 Listing file "./f4387audt.ext.130614.1".
. 2013-06-18 11:33:12.041 Retrieving file information...
> 2013-06-18 11:33:12.041 MLST /./f4387audt.ext.130614.1
< 2013-06-18 11:33:15.057 500 Syntax error, command unrecognized.
. 2013-06-18 11:33:15.057 Could not retrieve file information
< 2013-06-18 11:33:15.057 Script: Can't get attributes of file './f4387audt.ext.130614.1'.
< 2013-06-18 11:33:15.057 Script: Could not retrieve file information
< 2013-06-18 11:33:15.057 Syntax error, command unrecognized.
. 2013-06-18 11:33:15.057 Script: Failed

Retrieving the same file using the UI version WinSCP UI works without issues.
I have the following C# code (simplified) in V2010 .NET4.0, which works for other FTP sites.
this.sessionOptions = new SessionOptions();
this.sessionOptions.Protocol = WinSCP.Protocol.Ftp;
this.sessionOptions.FtpMode = FtpMode.Active;
this.sessionOptions.HostName = host;
this.sessionOptions.PortNumber = port;
this.sessionOptions.UserName = user;
this.sessionOptions.Password = password;
this.session = new Session();
this.session.SessionLogPath = Path.Combine(Environment.CurrentDirectory, AppDomain.CurrentDomain.FriendlyName + "_Log.txt");

string localFile = Path.Combine(localFilePath, string.IsNullOrEmpty(localFileName) ? fileInfo.Name : localFileName);
string remoteFile = "./" + fileInfo.Name;
TransferOperationResult result = this.session.GetFiles(remoteFile, localFile);
if (!result.IsSuccess) { // ERROR. }

How do I fix this error as I would like to use one solution for FTP and SFTP.

Thank you,
GetAUDT.vshost.exe_Log.txt (54.44 KB) [Download]

Description: Session Log File

[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26890
Location: Prague, Czechia
You have to use absolute paths with .NET assembly.
Martin Prikryl

You can post new topics in this forum


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!


About donations

$9   $19   $49   $99

About donations


WinSCP Privacy Policy

WinSCP License