paulnamroud
asked on
Vb.Net - Copy an image from a URL to a specific path ???
Hi everyone,
I need your help.
I'm writing a Vb.Net application which should copy many images (images001.jpg, images002.jpg...) from an URL address (i.e http://mysite.com/images/images001.jpg).
I don't know how to copy each image from the URL address (i.e http://mysite.com/images/) to a network path (i.e \\MyNetwork\Images\).
I had already found on internet a code which allow me to check the existence of any image giving a URL address.
Can anyone tell me how to copy an image from a URL to a specific path ?
Thank you.
Paul
Function ImageExiste(ByVal p_url As String) As Boolean
Dim xmlHttp
xmlHttp = CreateObject("Microsoft.xm lHttp")
xmlHttp.Open("GET", p_url, False)
xmlHttp.Send()
Select Case xmlHttp.status
Case 200 'found
ImageExiste = True
Case 404 'Not found
ImageExiste = False
Case Else 'Some other problem
ImageExiste = False
End Select
'ImageExiste = xmlHttp.Status
xmlHttp = Nothing
End Function
I need your help.
I'm writing a Vb.Net application which should copy many images (images001.jpg, images002.jpg...) from an URL address (i.e http://mysite.com/images/images001.jpg).
I don't know how to copy each image from the URL address (i.e http://mysite.com/images/) to a network path (i.e \\MyNetwork\Images\).
I had already found on internet a code which allow me to check the existence of any image giving a URL address.
Can anyone tell me how to copy an image from a URL to a specific path ?
Thank you.
Paul
Function ImageExiste(ByVal p_url As String) As Boolean
Dim xmlHttp
xmlHttp = CreateObject("Microsoft.xm
xmlHttp.Open("GET", p_url, False)
xmlHttp.Send()
Select Case xmlHttp.status
Case 200 'found
ImageExiste = True
Case 404 'Not found
ImageExiste = False
Case Else 'Some other problem
ImageExiste = False
End Select
'ImageExiste = xmlHttp.Status
xmlHttp = Nothing
End Function
ASKER
Sorry, but it didn't work the method you gave me ...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I think the points should be split between myself and dave_moats.
I think Kinger's suggestion is valid as both solutions can be used to answer the question.
I agree.
w.DownloadFile(address, filename)