Re: download and save an image from a website

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: caglaror (caglaror_at_gmail.com)
Date: 02/17/05


Date: 17 Feb 2005 13:36:42 -0800

start=InputBox("Please give the starting number")
finish=InputBox("Please give the last number")
FOR oder_no=start TO finish
   On Error Resume Next
  piece= CStr(order_no) & ".wma"
  cURL = "http://www.anadolurock.com/arsiv/wma/" & piece
   Dim strDIR
       strDIR = WScript.ScriptFullName
       strDIR = Left(strDIR,InStrRev(strDIR,"\"))
   Dim strFIL
       strFIL = Mid(cURL,InStrRev(cURL,"/")+1)
   Dim objADO
   Set objADO = CreateObject("ADODB.Stream")
   Dim objXML
   Set objXML = CreateObject("Microsoft.XMLHTTP")
       objXML.Open "GET", cURL, False
       objXML.Send
   If Err.Number = 0 And objXML.Status = 200 Then
       objADO.Type = 1
       objADO.Open
       objADO.Write objXML.ResponseBody
       objADO.SaveToFile strDIR & strFIL,2
       booMSG = True
   End If
   Set objADO = Nothing
   Set objXML = Nothing
NEXT



Relevant Pages

  • Re: VbScript
    ... > Dim strIMG ... > Dim objIMG ... > Set objIMG = Nothing ... > Dim objADO ...
    (microsoft.public.scripting.vbscript)
  • Re: Q. for McKirahan re: HTAs
    ... > '* Declare Constants ... > Dim arrRST ... > Dim objADO ... > Set objRST = Nothing ...
    (microsoft.public.scripting.vbscript)
  • The script cause an error of writing (SaveToFile error)
    ... Dim strDIR ... 'strDIR = WScript.ScriptFullName ... Dim objADO ... Set objADO = CreateObject ...
    (microsoft.public.scripting.vbscript)
  • Re: Access database
    ... >> Dim Connection, sConnString ... > '* Declare Constants ... > Dim objADO ... > Set objRST = Nothing ...
    (microsoft.public.scripting.vbscript)
  • Re: Needing Help with FTP/Date Change downloads
    ... >> next automatic download from the FTP server will pull Document09202005? ... > Dim strNOW ... > Dim objADO ...
    (microsoft.public.scripting.vbscript)