upload image using the WebRequest
i need to upload a image to a site by using
the WebRequest so far i have this for send values:
but for send a image i have no ideia how do, i have looking for samples but
Dim request As WebRequest = WebRequest.Create(site_name)
request.Method = "POST"
Dim byteArray As Byte() = Encoding.ASCII.GetBytes(post_value)
request.ContentType = "application/x-www-form-urlencoded"
request.ContentLength = byteArray.Length
Dim dataStream As Stream = request.GetRequestStream()
dataStream.Write(byteArray, 0, byteArray.Length)
Dim response As WebResponse = request.GetResponse()
dataStream = response.GetResponseStream()
Dim reader As New StreamReader(dataStream)
Dim responseFromServer As String = reader.ReadToEnd()
i only find for c# and i need this for vb.net
what i need change in my code to upload images to?
and other question how can i send cookies to the page?
thanks a lot for your help