Link to home
Start Free TrialLog in
Avatar of timpeters
timpeters

asked on

retrieving internet file

I cannot get my code right.  I am trying to take a file that is on a local internet server and place it in a file on my C: drive.  I am able to post a file from my PC to the internet server, but not vice versa.  I am confused with all the Get, Put, OpenURL, etc. statements.  Code would be very useful.
Avatar of waty
waty
Flag of Belgium image

Here is the way :

' Retrieve latest software update from ftp.mycompany.com.

Dim bFile() as Byte         ' Retrieving a binary file.

' Retrieve the file.
bFile() = icTransfer.OpenURL _
    ("ftp://ftp.mycompany.com/upgrade/software.exe", _
    icByteArray)

' Write file to disk.
Open "C:\INTERNET\software.exe" For Binary Access Write As #1
Put #1, , bFile()
Close #1

Avatar of timpeters
timpeters

ASKER

I am not supposed to use ftp.  I know there is another way.  I am able to post this file to my local internet server without ftp.  I will give you an extra 50 points if you can help.  Thanks.  

To post it, I connected my internet transfer control, called INET1, to my server. I used the this in conjunction with a "INET1.Execute, 'PUT', data1" statement, where data1 was my file. I don't know if this helps.
This is sort of a rush problem
ASKER CERTIFIED SOLUTION
Avatar of waty
waty
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank You