I'm using https with basic authentication, I can connect and read a file with GetProcessedFile but the methods PutFile and GetRawFile returns allways 403 Forbidden
// Tls1.2
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;
// Ignore certificate check
ServicePointManager.ServerCertificateValidationCallback +=
(se, cert, chain, sslerror) =>
{
return true;
};
WebDavClientParams clientParams = new WebDavClientParams();
clientParams.BaseAddress = new Uri(config.host); // HTTPS URI
clientParams.Credentials = new NetworkCredential(config.user, config.pass);
var client = new WebDavClient(clientParams);
foreach (string file in Directory.EnumerateFiles(this.localFolder, "*", SearchOption.AllDirectories))
{
string dirName = file.Replace(this.localFolder, "");
dirName = dirName.Replace("\\", "/");
string dest = config.host + config.remoteFolder + dirName;
var response = await client.GetRawFile(config.host + "/test.txt"); ->status code 403
var response2 = await client.GetProcessedFile(config.host + "/test.txt"); -> status code 200
var response1 = await client.PutFile(dest, File.OpenRead(file)); -> status code 403
}
I want to upload local files to the server
any idea?
I'm using https with basic authentication, I can connect and read a file with GetProcessedFile but the methods PutFile and GetRawFile returns allways 403 Forbidden
I want to upload local files to the server any idea?