Inet put command not working
I am trying to get my inet control to put a file from one file folder, to a backup file folder on an ftp site.
When I use the same arguments and do it manually, the file is copied to the correct file folder.
When I try to run it with my code using the inet control, no file is copied.
Can someone tell me why?
Here is my code.
VB Code:
With Menu.Inet1
.URL = strUrl
.UserName = strUser
.Password = strPass
.Execute , "cd " & strFile1
Do While Menu.Inet1.StillExecuting = True
DoEvents
Loop
.Execute , "DIR"
Do While Menu.Inet1.StillExecuting = True
DoEvents
Loop
Do
DoEvents
var_data = Menu.Inet1.GetChunk(1024, icString)
str_data = str_data & var_data
Loop Until Len(va_data) = 0
str_data = Trim(str_data)
If str_data <> "" Then
strftpfiles = Split(str_data, vbCrLf)
For i = 0 To UBound(strftpfiles)
Debug.Print strftpfiles(i)
If Left(strftpfiles(i), 6) = "D50" & strStore Then
.Execute , "PUT " & Trim(strftpfiles(i)) & " Backup\" & Trim(strftpfiles(i))
Do While Menu.Inet1.StillExecuting = True
DoEvents
Loop
End If
Next i
End If
End With
The key line of code is this:
.Execute , "PUT " & Trim(strftpfiles(i)) & " Backup\" & Trim(strftpfiles(i))
This looks like this... "Put D50002.600 Backup\D50002.600"
Thanks