Results 1 to 3 of 3

Thread: ftp please help

  1. #1
    Guest

    Angry

    I am reading a directory of files and attempting to ftp the whole directory to my web server using the internet transfer control.
    I keep getting the error
    "still executing last request" on the execute statement
    is there a way to hold the loop up until the previous
    request has finished, or is there a way I can ftp a whole directory in batch mode or something
    Code:
    Dim fs, f, f1, fc, s, fol, st
    Dim source As String
    Dim x As Integer
    
        Set fs = CreateObject("Scripting.FileSystemObject")
        Set f = fs.GetFolder(directory)
        Set fc = f.Files
        fol = Text4.Text
        With Inet1
            .Cancel
            .Protocol = icFTP
            .URL = "xxx.xxx.xxx.xxx"
            .UserName = "xxxx"
            .Password = "xxxx"
        End With
        For Each f1 In fc
            s = f1.Name
            source = fol & "\" & s
            Inet1.Execute "xxx.xxx.xxx.xxx", _
            "PUT " & source & " /" & s
            x = x + 1
        Next
    MsgBox x & " Files transfered"

  2. #2
    Guest

    Stillexecuting

    You can do one of two things:

    Either check the stillexecuting property of the inet control
    before sending the next file

    or

    use the "MPUT *.*" FTP command instead of the "PUT " & filename command.

    Hope that helps, I've had the same problem before.

    - John

  3. #3
    Lively Member
    Join Date
    Jan 1999
    Location
    Karjalohja, Finland
    Posts
    123
    Try this:

    For Each f1 In fc
    s = f1.Name
    source = fol & "\" & s
    Inet1.Execute "xxx.xxx.xxx.xxx", _
    "PUT " & source & " /" & s
    x = x + 1
    Do
    DoEvents
    Loop While Inet1.StillExecuting
    Next

    - Jani

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width