Posting binary / image files

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

I'm trying to post an image using the Web Browser control:

object oURL="http://www.somedomain.com/test.php"; //form processing

cPostData = @"userfile=C:\\avatar.jpg";
vHeaders = "Content-Type: multipart/form-data" + "\n" + "\r";

vPost = ASCIIEncoding.ASCII.GetBytes(cPostData);

axWebBrowser1.Navigate2(ref oURL, ref oEmpty, ref oEmpty, ref vPost, ref vHeaders);

Of course it doesn't work. What must I do to correctly load up the image to be posted, as happens when using the <input Type='file' .... browse box?

In addition if anone knows how to do the same thing using HttpWebRequest, that would be helpful too.

Thanks
Magnus
 
Thanks Todd, I'm trying this but still no success yet. I saw by your other post you're interested in something similar. If you find any interesting examples I'd be grateful if you could post a link here and I will check back every so often.

Thanks
Magnus
 
Thanks Todd, I'm trying this but still no success yet. I saw by your other post you're interested in something similar. If you find any interesting examples I'd be grateful if you could post a link here and I will check back every so often.

Thanks
Magnus
 
Thanks Todd, I'm trying this but still no success yet. I saw by your other post you're interested in something similar. If you find any interesting examples I'd be grateful if you could post a link here and I will check back every so often.

Thanks
Magnus
 
Back
Top