VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Download Binary (graphics/executables) over http without Inet Controls

by Bradley Dick (1 Submission)
Category: Internet/HTML
Compatability: Visual Basic 3.0
Difficulty: Intermediate
Date Added: Wed 3rd February 2021
Rating: (6 Votes)

Download Binary (graphics/executables) over http without Inet Controls or Api's. This program uses xmlhttp to grab it and then writes it to a file. This is very helpful for an app that is distibuted on multiple platforms because the inet controls are so buggy when trying to install on user that don't have it.

Inputs
Url
Assumes
The user needs to have XMLDOM on the computer
Code Returns
Binary

Rate Download Binary (graphics/executables) over http without Inet Controls

' Code By: Bradley Dick ([email protected])
'
'
'
' Use this code as much as you like it really saved me a lot of headache. All I ask is that you reply and vote. Thanks All this is my first post....... 
'
'
' Explantion:
' strUrl is the path to the file you want ie.(http://www.abc.com/logo.gif)
' strFile is the path where you want to save the file and the name. ie.(C:\logo.gif)
'That's it... Just make sure that you include the Microsoft XML 3.0 or if you use a different on then just change the dim and the set statement..

Private Sub GetFile(strURL As String, strFile As String)
    Dim xml As MSXML2.XMLHTTP30
    Dim X() As Byte
    Set xml = New MSXML2.XMLHTTP30
      xml.Open "GET", strURL, False
      xml.send
      X = xml.responseBody      
  Open strFile For Binary Access Write As #1
      Put #1, , X()
      Close #1
End sub

Download this snippet    Add to My Saved Code

Download Binary (graphics/executables) over http without Inet Controls Comments

No comments have been posted about Download Binary (graphics/executables) over http without Inet Controls. Why not be the first to post a comment about Download Binary (graphics/executables) over http without Inet Controls.

Post your comment

Subject:
Message:
0/1000 characters