Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

retrieving internet file

Posted on 1998-09-10
5
Medium Priority
?
137 Views
Last Modified: 2010-04-30
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.
0
Comment
Question by:timpeters
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 14

Expert Comment

by:waty
ID: 1434050
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

0
 

Author Comment

by:timpeters
ID: 1434051
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.
0
 

Author Comment

by:timpeters
ID: 1434052
This is sort of a rush problem
0
 
LVL 14

Accepted Solution

by:
waty earned 1000 total points
ID: 1434053
By doing this (using OpenUrl), you will not use FTP, you open directly the URL and save it.

If you want to use FTP you should do as follow :

icMain.Execute sURL, "CD " & m_rstSites("Directory")
zsWaitForResponse

icMain.Execute sURL, "USER " & icMain.UserName & " " & icMain.Password
zsWaitForResponse

icMain.Execute sURL, "CD " & m_rstSites("Directory")
zsWaitForResponse

icMain.Execute sURL, "GET aFile " & sFileName    zsWaitForResponse




Sub zsWaitForResponse()

' After executing an FTP command, we have to wait for it to complete
' before we undertake any further processing.

Do Until Not icMain.StillExecuting
    DoEvents
    ' We can do other things here.
Loop

End Sub

0
 

Author Comment

by:timpeters
ID: 1434054
Thank You
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question