D
Darvin
I use the FTPClient by Stuart McCall to transfer files to an ftp site. I want
to transfer a file with a temporary "tmp" prefix, then when it's totally
uploaded I want to rename it by removing the prefix. Here's my code:
With New FTPClient
.OpenFTP
.OpenServer cstrServer, cstrUser, cstrPW
.PutFile cstrDir & "/" & cstrSubDir, "tmp" &
strFinalZippedName, strLocalDir & strFinalZippedName
.GetFileNames "", strFinalZippedName
If .FileNames.Count > 0 Then
.DelFile "", strFinalZippedName
Else
.SetDir "."
End If
.RenFile "tmp" & strFinalZippedName, strFinalZippedName
.CloseServer
.CloseFTP
End With
This code works fine to upload but I must be doing something wrong when I
try to delete any existing files so that I can rename the new upload.
Can anyone help me with this?
Thanks in advance
-Darvin
to transfer a file with a temporary "tmp" prefix, then when it's totally
uploaded I want to rename it by removing the prefix. Here's my code:
With New FTPClient
.OpenFTP
.OpenServer cstrServer, cstrUser, cstrPW
.PutFile cstrDir & "/" & cstrSubDir, "tmp" &
strFinalZippedName, strLocalDir & strFinalZippedName
.GetFileNames "", strFinalZippedName
If .FileNames.Count > 0 Then
.DelFile "", strFinalZippedName
Else
.SetDir "."
End If
.RenFile "tmp" & strFinalZippedName, strFinalZippedName
.CloseServer
.CloseFTP
End With
This code works fine to upload but I must be doing something wrong when I
try to delete any existing files so that I can rename the new upload.
Can anyone help me with this?
Thanks in advance
-Darvin