Geeks With Blogs
.Nettuce Code Salad April 2012 Entries
Multipart form using WebRequest
void UploadStream(string fileName, Stream stream, string uri, string authorizationHeader) { var webRequest = WebRequest.Create(uri); var boundary = DateTime.Now.Ticks.ToString(); webRequest.ContentType = "multipart/form-data; boundary=" + boundary; webRequest.Method = HttpMethod.Post; webRequest.Headers["Authori... = authorizationHeader; var memoryStream = new MemoryStream(); stream.CopyTo(memoryStream); var byteArray = memoryStream.ToArray(); var postData = new MemoryStream(); const string ......

Posted On Friday, April 20, 2012 10:09 AM

Copyright © Jon Canning | Powered by: GeeksWithBlogs.net