Web.Client.UploadData()

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

Guest

I am using WebClient.UploadData(URL) to upload a strng to the particular URL.
How do I read the uploaded data or where excatly the data is stored, so that
I can use in my destination web page.

Raj
 
Raj,

If you use the UploadData method, by default, the information is sent
with a POST request over HTTP. In order to access this through ASP.NET, you
would have to access the Form property which is returned from the
HttpRequest returned by the Request property on your page. This means that
you will have to send the string as a name/value pair (the way that a
browser will encode it).

If you don't want to encode it, I believe you can access the raw content
through the InputStream property on the Request, or through the Headers
collection exposed by the request (but I can't recall which header it is).

Hope this helps.
 
Back
Top