I need to implement uploading and downloading files as cheap as possible. For my tests I use Windows XP with IIS 5 and a console C# program.
I created a virtual directory in IIS and in my program I execute the following code:
System.Net.WebClient webClient = new System.Net.WebClient();
webClient.Credentials = System.Net.CredentialCache.DefaultCredentials;
webClient.UploadFile( "http://localhost/Exchange/file.jpg", "PUT", localPathToMyFile );
those lines execute successfully and a file appears in the directory used to serve contents to the virtual directory. The problem is the file contents in surrounded by extra data:
-----------------------8ccfabf2a995855
Content-Disposition: form-data; name="file"; filename="file.jpg"
Content-Type: application/octet-stream
//file contents goes here
-----------------------8ccfabf2a995855
Where does this extra data come from? What do I do so that it doesn't appear, but the file is uploaded as is?