Posting binary / image files

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
 
G

Guest

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
 
G

Guest

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
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top