pbuddy2007
Technical User
I'm using a loop to upload all the files in a folder to a FTP server using the code below. The problem is that often not all the files are uploaded ????
Code:
Dim i As Long
Dim sError As String
Dim strFullPath As String, strRelativeName As String, strRelativePath As String
Dim objFTP As ASPFTP
Dim strMsg
Dim profilenum As Integer
Dim tdesign As String
Dim wsh
'On Error Resume Next
Set wsh = CreateObject("WScript.Shell")
PathLogInit
LogPath App.Path & "\output\site1", strFNAMES, lngPptrs, strPaths
'create reference to object
Set objFTP = New ASPFTP
objFTP.sServerName = "1.2.3.4"
objFTP.sUserID = "user"
objFTP.sPassword = "pass"
If objFTP.bConnect() Then
objFTP.bMakeDir "HTTPDOCS\site3"
For i = 1 To UBound(strFNAMES)
strFullPath = strPaths(lngPptrs(i)) & strFNAMES(i)
strRelativeName = GetRelativeName(strFullPath)
strRelativePath = GetRelativePath(strFullPath)
strRelativePath = "\HTTPDOCS\site3" & strRelativePath
strRelativeName = "\HTTPDOCS\site3" & strRelativeName
'now make the directory
Label5.Caption = "Creating folder " & strRelativePath & vbCrLf
DoEvents
objFTP.bMakeDir strRelativePath
Label5.Caption = "Copying file " & strRelativeName & vbCrLf
DoEvents
objFTP.bPutFile strFullPath, strRelativeName
Next i
Set objFTP = Nothing
else
'error code
end if