PDA

Click to See Complete Forum and Search --> : ftp please help


Apr 18th, 2000, 06:50 AM
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

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"

Apr 22nd, 2000, 12:56 AM
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

dj4
May 1st, 2000, 03:17 PM
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