By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,984 Members | 1,423 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,984 IT Pros & Developers. It's quick & easy.

I am sending image through WebRequest

P: 1
I am sending image through webrequest to my live server but i am not able to get image file on server how to get the image if any on help me please.


WebRequest request = WebRequest.Create("http://192.168.1.26/Madhav/SaveClinicalFundusImages.aspx");


request.Method = "POST";

string postData = @"C:\FHPL\FORUS0421\140421115725\Images\0001CL0D.j pg"; //Convert.ToBase64String(x);

byte[] byteArray = Encoding.UTF8.GetBytes(postData);
request.ContentType = "application/x-www-form-urlencoded";

request.ContentLength = byteArray.Length;
Stream dataStream = request.GetRequestStream();
dataStream.Write(byteArray, 0, byteArray.Length);

dataStream.Close();

please help me
Dec 31 '18 #1
Share this Question
Share on Google+
1 Reply


Expert 100+
P: 1,032
What is the size of your picture? and what is the size of our variable 'byteArray'?

Above is a hint, because i do not think you are sending a picture, but you are only sending it's name.
Jan 1 '19 #2

Post your reply

Sign in to post your reply or Sign up for a free account.