K
kieran
Hi,
I want to download an image from the web and save it locally. I have
spent all day messing about with this and am still no where. We have
a firewall so i use the below code. I know it works down to the line
as i also use this code to download an xml file from the net. I have
been messing around with all sorts of ways to stream the image into a
local file and save it. but no luck.
Am i totally off key here, can anyone point me in the right direction
to do what i thought would be a simple thing.
<code>
Dim sURL As String
sURL = "http://www.google.ie/images/hp0.gif"
Dim wrGETURL As WebRequest
wrGETURL = WebRequest.Create(sURL)
Dim saByPassList() As String
Dim myProxy As New WebProxy("10.32.0.20:8080", True,
saByPassList, New NetworkCredential("user", "password", "domain"))
myProxy.BypassProxyOnLocal = True
wrGETURL.Proxy = myProxy
Dim objStream As Stream
objStream = wrGETURL.GetResponse.GetResponseStream()
---------------------------------------
Dim br As New BinaryReader(objStream)
Dim arrPicture() As Byte = br.ReadBytes(objStream.Length)
</code>
Thanks.
I want to download an image from the web and save it locally. I have
spent all day messing about with this and am still no where. We have
a firewall so i use the below code. I know it works down to the line
as i also use this code to download an xml file from the net. I have
been messing around with all sorts of ways to stream the image into a
local file and save it. but no luck.
Am i totally off key here, can anyone point me in the right direction
to do what i thought would be a simple thing.
<code>
Dim sURL As String
sURL = "http://www.google.ie/images/hp0.gif"
Dim wrGETURL As WebRequest
wrGETURL = WebRequest.Create(sURL)
Dim saByPassList() As String
Dim myProxy As New WebProxy("10.32.0.20:8080", True,
saByPassList, New NetworkCredential("user", "password", "domain"))
myProxy.BypassProxyOnLocal = True
wrGETURL.Proxy = myProxy
Dim objStream As Stream
objStream = wrGETURL.GetResponse.GetResponseStream()
---------------------------------------
Dim br As New BinaryReader(objStream)
Dim arrPicture() As Byte = br.ReadBytes(objStream.Length)
</code>
Thanks.