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