I have a database of the remote location of over 500 images that I would like to download.
I am writing a stored procedure that uses an http object to download the images locally.
For the purposes of answer in the question, let's name the stored procedure sp_download_images
The file name being download is @filename
The local destination for the image is @filelocal
The remote http location for the image is @filehttp
I have written the cursor to get the image names, but I need assistance in coding the creation of the http object and invoking the object to download the file from the remote http location to the local destination.
Here is the ASP Equivalent of what I am trying to do in SQL. I think all that needs to be done is use SP_OACreate and SP_OAMethod, but I am unsure of the method arguments for SP_OAMethods
sSource = http://www.mygolfgear.com/products/iStourplusequilizer.jpg
sDest = C:\temp\iStourplusequilize
set oHTTP = Server.CreateObject("Micro
oHTTP.open "GET", sSource, False
set oStream = server.createobject("adodb
Const adTypeBinary = 1
Const adSaveCreateNotExist = 1
Const adSaveCreateOverWrite = 2
oStream.type = adTypeBinary
oStream.savetofile sDest, adSaveCreateOverWrite
set oStream = nothing
set oHTTP = nothing