How do I upload a file to a folder using webdav?

I have this webdav code that creates folders in SharePoint:

HttpWebRequest request = (System.Net.HttpWebRequest)HttpWebRequest.Create(folderAddress);
                request.Credentials = wsLists.Credentials; // CredentialCache.DefaultCredentials;
                request.Method = "MKCOL";
                response = (System.Net.HttpWebResponse)request.GetResponse();
                response.Close();

      

How do I now change the code to download the file to this newly created folder. I think this is a general webdav question, thanks

+2


source to share


2 answers


You can do it with WebClient.UploadFile

see also this question for using HttpRequest: webclient-upload-file-error



or google search WebClient.UploadFile webdav

+3


source


Take a look at Fast Uploading Multiple Folders / Files with WebDAV and also check About Uploading with WebDAV for Folder Transfer



0


source







All Articles