FTP.PassiveMode = True
For Each pdfFile In pdfList
If pdfFiles.EndsWith(".pdf") Then
Dim sf As Object = FTP.UploadFile(File.DirInternal, pdfFiles, False, "/Test_Folder/" & pdfFiles)
Wait For (sf) FTP_UploadCompleted (ServerPath As String, Success As Boolean)
Log(ServerPath & ": "& Success)
End If
Next
FTP.Close
Thanks Erel. I will give it a try...You will need to upload them one by one.
Shouldn't be too complicated with Wait For: [B4X] Net library (FTP, SMTP, POP) with Wait For
Dim pdfList As List
Dim i As Int
pdfList.Initialize
pdfList=File.ListFiles(File.DirInternal)
For i=0 To pdfList.Size-1
pdfFiles=pdfList.Get(i)
If pdfFiles.EndsWith(".pdf")
FTP.PassiveMode = True
FTP.UploadFile(File.DirInternal, pdfFiles, False, "/Test_Folder/" & pdfFiles)
FTP.Close
End If
Next
Dim pdfList As List
Dim i As Int
pdfList.Initialize
pdfList=File.ListFiles(File.DirInternal)
For i=0 To pdfList.Size-1
pdfFiles=pdfList.Get(i)
If pdfFiles.EndsWith(".pdf") Then
FTP.PassiveMode = True
Dim sf As Object = FTP.UploadFile(File.DirInternal, pdfFiles, False, "/Test_Folder/" & pdfFiles)
Wait For (sf) FTP_UploadCompleted (ServerPath As String, Success As Boolean)
FTP.Close
End If
Next
Sub FTP_UploadProgress (ServerPath As String, TotalUploaded As Long, Total As Long)
Dim s As String
s = "Uploaded " & Round(TotalUploaded / 1000) & "KB"
If Total > 0 Then s = s & " out of " & Round(Total / 1000) & "KB"
Log(s)
End Sub
Sub FTP_UploadCompleted (ServerPath As String, Success As Boolean)
Log(ServerPath & ", Success=" & Success)
If Success = True Then
Log("COPIED")
Else
Log(LastException.Message)
End If
End Sub
FTP.PassiveMode = True
For Each pdfFile In pdfList
If pdfFiles.EndsWith(".pdf") Then
Dim sf As Object = FTP.UploadFile(File.DirInternal, pdfFiles, False, "/Test_Folder/" & pdfFiles)
Wait For (sf) FTP_UploadCompleted (ServerPath As String, Success As Boolean)
Log(ServerPath & ": "& Success)
End If
Next
FTP.Close