Jeff Roberts wrote: > Is it possible to write/overwrite a file on a web server with > the HttpWebRequest Class ? I am currently using > HttpWebRequest to read a file from a web site and need to > know if I can also write the file, given I have permission to > do so. I know I can't seek, but can I write ? Is there any > way to specify a user name and password for file access in > this scenario ? >
Hi Jeff, I think you may be happy with the System.Net.WebClient class, which has an UploadFile method. You can specify PUT for your method and create a file on the server, like this: WebClient myWebClient = new WebClient(); myWebClient.UploadFile( "http://localhost:8080/puttest/test.xml", "PUT", "c:\\test.xml" ); My understanding of the permissions side is that you can use a combination of IIS configuration and the WebClient.Credentials property to restrict write access to that file. Chris Dix You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced DOTNET, or subscribe to other DevelopMentor lists at http://discuss.develop.com.