I am trying to download to a local text file. Here is my code:
Private Sub Command1_Click()
Dim b() As Byte
Dim strURL As String
' Set the strURL to a valid address.
strURL = "
' Retrieve the file as a byte array.
b() = Inet1.OpenURL(strURL, icByteArray)
' ** create directory on your machine with directory target
Open "C:\FileToDownload.txt" For Binary Access _
Write As #1
Put #1, , b()
Close #1
End Sub
I actually worked, however the ouput text file has totally different format as the website. Does anyone know how to keep the web file format after the download?
Thanks a lot.
Private Sub Command1_Click()
Dim b() As Byte
Dim strURL As String
' Set the strURL to a valid address.
strURL = "
' Retrieve the file as a byte array.
b() = Inet1.OpenURL(strURL, icByteArray)
' ** create directory on your machine with directory target
Open "C:\FileToDownload.txt" For Binary Access _
Write As #1
Put #1, , b()
Close #1
End Sub
I actually worked, however the ouput text file has totally different format as the website. Does anyone know how to keep the web file format after the download?
Thanks a lot.