Solved

ftp vs copy

Posted on 2003-10-28
5
359 Views
Last Modified: 2010-05-03
We need to copy multiple files from 1 server to another on regular basis.
Copy is not fast enough. I was told, ftp may be faster ?

Also, if ftp is a better way to do it, how would I code it from VB ?

Thank You
-Alex
0
Comment
Question by:AlexF777
[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
5 Comments
 
LVL 28

Accepted Solution

by:
vinnyd79 earned 150 total points
ID: 9635214
Yes FTP would be faster.
0
 
LVL 28

Assisted Solution

by:vinnyd79
vinnyd79 earned 150 total points
ID: 9635223
There is a good class module you can use from this project:

http://www.freevbcode.com/ShowCode.ASP?ID=1593
0
 
LVL 28

Assisted Solution

by:vinnyd79
vinnyd79 earned 150 total points
ID: 9635239
There is also a free FTP control on this page:

http://www.chilkatsoft.com/downloads.asp
0
 
LVL 9

Assisted Solution

by:Dang123
Dang123 earned 50 total points
ID: 9635389
You may also try something like this


Public Sub TransferFileFTP()
    '*****************************************************************************************
    '
    ' Parameters:       none
    '
    ' Global Updates:   none
    '
    ' Global Read:      No global variables should be read
    '
    ' Return:           No return value - Sub
    '
    ' Description:
    '   Control FTP transfer.
    '
    '*****************************************************************************************
    On Error GoTo ErrorCode
   
    Dim hndFile         As Integer
    Dim strFTP          As String
    Dim strBAT          As String
    Dim strLOG          As String
    Dim strPath         As String
   
    strPath = App.Path & "\"
    strFTP = strPath & "FileFTP.FTP"
    strBAT = strPath & "FileFTP.BAT"
    strLOG = strPath & "FileFTP.LOG"
   
    hndFile = FreeFile
    Open strFTP For Output As #hndFile
    Print #hndFile, "open RemoteMachine"
    Print #hndFile, "user someid"
    Print #hndFile, "password"
    Print #hndFile, "GET ""RemoteFile1.txt"" ""LocalFile1.txt"""
    Print #hndFile, "GET ""RemoteFile2.txt"" ""LocalFile2.txt"""
    Print #hndFile, "GET ""RemoteFile3.txt"" ""LocalFile3.txt"""
    Print #hndFile, "BYE"
    Close #hndFile
   
    hndFile = FreeFile
    Open strBAT For Output As #hndFile
    Print #hndFile, "ftp -n -s:""" & strFTP & """ > """ & strLOG & """"
    Close #hndFile
   
    Call Shell(strBAT, vbHide)
   
    Exit Sub
ErrorCode:
    Select Case Err.Number
        Case Else
            Err.Raise Err.Number, , "clsProcessRequest UploadFileFTP - " & Err.Description
    End Select
End Sub
0
 
LVL 14

Assisted Solution

by:aelatik
aelatik earned 50 total points
ID: 9636107
Use the INET control, this piece of script will fetch the entire FTP Directory for you...

    With Inet1
        .URL = "FTP://255.255.255.255"
        .UserName = "username"
        .Password = "password"
        .RemotePort = 21
        .Execute , "CD FILES/IMAGES"
         While .StillExecuting: DoEvents: Wend
        .Execute , "DIR"
         While .StillExecuting: DoEvents: Wend
         For Each Item In Split(.GetChunk(1024, icString), vbCrLf)
            If ARRAY_ITEM <> "" Then
                 While .StillExecuting: DoEvents: Wend
                .Execute , "GET " & Item & " C:\TEMP\" & Item
            End If
        Next
         Execute , "QUIT"
    End With
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

696 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