Click here to Skip to main content
16,018,353 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi I have below code

string uri = "http://localhost:38936/UploadService.svc/UploadFile/";
uri += Guid.NewGuid().ToString() + "/r/3/First_Chunk/siusdhf";

System.Net.HttpWebRequest req = WebRequest.Create(uri) as HttpWebRequest;
req.KeepAlive = false;
req.Method = "POST";

System.IO.Stream streamObj = req.GetRequestStream();

//D:\Images\C#.jpg

byte[] buffer = System.IO.File.ReadAllBytes(@"D:\Video\images.jpg");
//req.ContentLength = buffer.Length;
//req.ContentType = "application/octet-stream";

streamObj.Write(buffer, 0, buffer.Length);
streamObj.Close();


HttpWebResponse resp = req.GetResponse() as HttpWebResponse;

its giving exception of
The remote server returned an error: (404) Not Found

what's wrong in this?
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900