While in my server I have assigned full control permissions for the folder where the files needs to be uploaded.
The website's application pool identity is being set with a domain user credentials, the website has anonymous authentication enabled set with application pool identity.
Have tried with webclient's uploaddata and uploadfile, setting credentials with the same domain user credentials after taking input from webpage's htmlinputfile.
using (WebClient wcUpload = new WebClient())
{
wcUpload.Credentials = new System.Net.NetworkCredential(strCurrentUser, strPassword);
//wcUpload.UploadFile(@strDataFeedSchemaFile, XsdFileUpLoaded.PostedFile.FileName);
wcUpload.UploadData(@strDataFeedSchemaFile, buffer);
//strDataFeedSchemaFile is the file which needs to be replaced
//buffer is the byte[] from the htmlinputfile
}
Objective is to upload an XSD file from htmlinputfile control, and save/replace in an existing folder/directory in webserver.
What else I am missing out resulting me to UnauthorizedAccessException and Access to path is denied :(