Hello I want to upload a html file that is in my local to a remote folder in a server that contains a data dir with geoserver elements, and here is my code:
public void CopyWS(string SourcePath, string DestinationPath)
{
try
{
string SourcePath = Path.GetFullPath("Result.html");
string DestinationPath = @"http://xx.xx.xxx.:8080/geoserver/rest/workspaces/";
string authInfo = "admin:geoserver";
WebClient client = new WebClient();
client.Headers["Authorization"] = "Basic " + Convert.ToBase64String(Encoding.ASCII.GetBytes(authInfo));
client.UploadFile(DestinationPath, "PUT", SourcePath);
}
catch (Exception e)
{
MessageBox.Show(e.Message);
}
I´m getting the following error "Error 405 method not allowed". I´m trying with different methods like post instead of put but I´m getting the same error.
EDIT: Anybody think that maybe can be a security problem? With UploadData I´m getting the same error
EDIT: After a long time testing with different methods (UploadDatat i.e) I´m getting always the same error.I've been searching and reading around to that and couldn't fine anything really useful.
EDIT: Any idea?
Thanks in advance