Whats wrong with this code
-
'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. -
'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.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++
-
'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.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!
Sorry, the page you requested was not found.
Search Yahoo!
• advanced search • most popular
Yahoo! Web Hosting
Yahoo! Web Hosting has three affordable plans to meet your needs - starting at just $11.95.