Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. XML / XSL
  4. Whats wrong with this code

Whats wrong with this code

Scheduled Pinned Locked Moved XML / XSL
helpcomxmlquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    Usman Tasleem Akshaf
    wrote on last edited by
    #1

    'GetRemoteBinaryFile.vbs ImageFile = "back.gif DestFolder = "C:\ URL = "http://geocities.com/tasleem445/nam2.jpg" Set xml = CreateObject("Microsoft.XMLHTTP") xml.Open "GET", URL, False xml.Send set oStream = createobject("Adodb.Stream") Const adTypeBinary = 1 Const adSaveCreateOverWrite = 2 Const adSaveCreateNotExist = 1 oStream.type = adTypeBinary oStream.open oStream.write xml.responseBody ' Do not overwrite an existing file oStream.savetofile DestFolder & ImageFile, adSaveCreateNotExist ' Use this form to overwrite a file if it already exists' oStream.savetofile DestFolder & ImageFile,
    adSaveCreateOverWrite oStream.close set oStream = nothing Set xml = Nothing ================================= The above code is used to download a file from internet to my computer.I think that this code is fine but its not working.Please can anyone tell me what is the problem with this code.Do help. Thanks. Be FaithFull To Your Work.

    C K 2 Replies Last reply
    0
    • U Usman Tasleem Akshaf

      'GetRemoteBinaryFile.vbs ImageFile = "back.gif DestFolder = "C:\ URL = "http://geocities.com/tasleem445/nam2.jpg" Set xml = CreateObject("Microsoft.XMLHTTP") xml.Open "GET", URL, False xml.Send set oStream = createobject("Adodb.Stream") Const adTypeBinary = 1 Const adSaveCreateOverWrite = 2 Const adSaveCreateNotExist = 1 oStream.type = adTypeBinary oStream.open oStream.write xml.responseBody ' Do not overwrite an existing file oStream.savetofile DestFolder & ImageFile, adSaveCreateNotExist ' Use this form to overwrite a file if it already exists' oStream.savetofile DestFolder & ImageFile,
      adSaveCreateOverWrite oStream.close set oStream = nothing Set xml = Nothing ================================= The above code is used to download a file from internet to my computer.I think that this code is fine but its not working.Please can anyone tell me what is the problem with this code.Do help. Thanks. Be FaithFull To Your Work.

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      Usman Tasleem Akshaf wrote: I think that this code is fine but its not working. That's not very helpful. Does it compile ? Does it throw an exception ? What is going wrong ? Christian Graus - Microsoft MVP - C++

      1 Reply Last reply
      0
      • U Usman Tasleem Akshaf

        'GetRemoteBinaryFile.vbs ImageFile = "back.gif DestFolder = "C:\ URL = "http://geocities.com/tasleem445/nam2.jpg" Set xml = CreateObject("Microsoft.XMLHTTP") xml.Open "GET", URL, False xml.Send set oStream = createobject("Adodb.Stream") Const adTypeBinary = 1 Const adSaveCreateOverWrite = 2 Const adSaveCreateNotExist = 1 oStream.type = adTypeBinary oStream.open oStream.write xml.responseBody ' Do not overwrite an existing file oStream.savetofile DestFolder & ImageFile, adSaveCreateNotExist ' Use this form to overwrite a file if it already exists' oStream.savetofile DestFolder & ImageFile,
        adSaveCreateOverWrite oStream.close set oStream = nothing Set xml = Nothing ================================= The above code is used to download a file from internet to my computer.I think that this code is fine but its not working.Please can anyone tell me what is the problem with this code.Do help. Thanks. Be FaithFull To Your Work.

        K Offline
        K Offline
        KaptinKrunch
        wrote on last edited by
        #3

        When I ran this code I found a few things odd.. 1) When I changed the file type of back.gif to back.txt I got the following ------------------------------------------------------------------------------ Yahoo!

        Yahoo

        Yahoo! - Help


        Sorry, the page you requested was not found.

        Search Yahoo!

        • advanced search • most popular

        Yahoo! Web Hosting

        Yahoo! Web Hosting Yahoo! Web Hosting has three affordable plans to meet your needs - starting at just $11.95.

        Learn more...

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups