I have a present project to download files from a website to my server. can anyone give me a simple code on how to do this using the INet control.<br>
<br>
thanks.
TLiberty,<br>
<br>
Here is some code that I came up with after wrestling with this one for a while myself. This code is actually getting the filenames from an array, but you can change it any way you like to meet your needs. Let me know if you have any questions or problems. Hope it helps. <br>
<br>
'=============================<br>
' CODE<br>
'=============================<br>
Private Sub GetFiles()<br>
On Error GoTo errGetFiles<br>
Dim x() As Byte, i As Integer<br>
<br>
For i = 0 To UBound(aFileNames)<br>
Inet1.URL = "<A HREF="
& aFileNames(i)<br>
x = Inet1.OpenURL(, icByteArray)<br>
Open "C:\" & aFileNames(i) For Binary Access Write As #1<br>
Put #1, , x()<br>
Close #1<br>
Next i<br>
<br>
exitGetFiles:<br>
Exit Sub<br>
<br>
errGetFiles:<br>
Err.Raise 805, , "Error getting files from server"<br>
<br>
End Sub
Slightly off topic but... Kcronin - Did you happen to be the lead singer for REO Speedwagon? I bet you've heard that a 1000 times now huh? Opps, I mean 1000 and 1. <p>Steve Meier<br><a href=mailto:sdmeier@jcn1.com>sdmeier@jcn1.com</a><br><a href= > </a><br>
TLiberty,<br>
<br>
Well, in the code, you can specify the exact path of the file you downloaded. If you know the file type, such as Word, and already know the file path, then you can create an instance of Word and open your document in it.<br>
<br>
Hope this helps. <p>Kenneth W. Cronin, MCP<br><a href=mailto:kcronin@atdsystems.com>kcronin@atdsystems.com</a><br><a href=
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.