Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: Error download from specified directory

I'm afraid that WinSCP .NET assembly is not compatible with VMS.
sapurah

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