Error download from specified directory

Advertisement

sapurah
Joined:
Posts:
1

Error download from specified directory

Hello. I need to download my files from eg cer_data:[ccluserdir.bcs] on my openvms server. I can do it using the latest version of winscp by changing the directory to CER_DATA:[CCLUSERDIR.BCS]. Winscp tends to add the / before the directory name and this won't work on VMS. I am trying to do the same programatically but if I were to omit the /, it will detect my default folder which is /USER:[USER.D_PROD]. I've tried removing and adding the / to the beginning of the directory and end but still not working. Below is my code:

string strDownloadPath = "c:\download\";
string wildCard = "burn*.*";
string remotePath = "CER_DATA:[CCLUSERDIR.BCS]";

SessionOptions sessionOptions = new SessionOptions
{
Protocol = Protocol.Ftp,
HostName = hostName,
UserName = txtUsername,
Password = txtPassword,
PortNumber = 21,
};

using (Session session = new Session())
{
// Connect
session.Open(sessionOptions);
TransferOptions transferOptions = new TransferOptions();
transferOptions.TransferMode = TransferMode.Binary;
transferOptions.FileMask = strWidlcard;
TransferOperationResult transferResult;
transferResult = session.GetFiles(remotePath, strDownloadPath, true);
}

Thanks for any help

Reply with quote

Advertisement

Advertisement

You can post new topics in this forum