FTPS error: Operation not permitted

Advertisement

jgorodriguez
Joined:
Posts:
1

FTPS error: Operation not permitted

Hi,

I have problem with FTPS connection. When I try to download files from server (session.GetFiles), I get the next error: "Copying files from remote side failed. Unable to build data connection: Operation not permitted."

This is my code:

SessionOptions sessionOptions = new SessionOptions
{
FtpMode = FtpMode.Passive,
Protocol = Protocol.Ftp,
FtpSecure = FtpSecure.Explicit,
HostName = strFtpUrl,
PortNumber = strFtpPort,
UserName = strFtpUser,
Password = strFtpPass,
TlsHostCertificateFingerprint = strFtpHostKey,
Timeout = TimeSpan.FromSeconds(60)
};
sessionOptions.AddRawSettings("ProxyMethod", "3");
sessionOptions.AddRawSettings("ProxyHost", ConfigurationManager.AppSettings["UrlProxy"]);
sessionOptions.AddRawSettings("ProxyPort", ConfigurationManager.AppSettings["PortProxy"]);
sessionOptions.AddRawSettings("ProxyUsername", ConfigurationManager.AppSettings["UserProxy"]);
sessionOptions.AddRawSettings("ProxyPassword", ConfigurationManager.AppSettings["PassProxy"]);

using (Session session = new Session())
{
//session.DisableVersionCheck = true;
session.Open(sessionOptions);

var transferOptions = new TransferOptions {TransferMode = TransferMode.Ascii};
transferOptions.ResumeSupport.State = TransferResumeSupportState.Off;

// Download the files in the OUT directory.
var transferOperationResult = session.GetFiles(strFtpFullPath, strDestFullPath, false, transferOptions);

// Check and throw if there are any errors with the transfer operation.
transferOperationResult.Check();
}

Any ideas?

Thanks!!

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
28,542
Location:
Prague, Czechia

Re: FTPS error: Operation not permitted

Can you download the files using WinSCP GUI or any other FTP client?
_________________
Martin Prikryl

Reply with quote

Advertisement

You can post new topics in this forum