By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,060 Members | 1,287 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,060 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("");

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);


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

Expert 100+
P: 1,043
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.