suicehockey44
asked on
C# App post *.csv file to website
Hi.
I've created a small app that logs on to a website. I am not using a WebBrowser but using HttpWebRequest and WebResponse. So now I have:
StreamReader streamReader = new StreamReader(webresponse.G etResponse Stream());
string html = streamReader.ReadToEnd();
In that html, somewhere, is a text box to add a file location and a POST method.
How do I target these properties/methods using HttpWebRequest?
Thank you.
I've created a small app that logs on to a website. I am not using a WebBrowser but using HttpWebRequest and WebResponse. So now I have:
StreamReader streamReader = new StreamReader(webresponse.G
string html = streamReader.ReadToEnd();
In that html, somewhere, is a text box to add a file location and a POST method.
How do I target these properties/methods using HttpWebRequest?
Thank you.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Once you find out the url to upload from the html, then for single file uploads using WebClient is simpler than using HttpWebRequest/POST
WebClient client = new WebClient();
byte[] responseBinary = client.UploadFile(url, fileName);
string response = Encoding.UTF8.GetString(re
You can check out this link => http://aspnetupload.com/Upload-File-POST-HttpWebRequest-WebClient-RFC-1867.aspx