Public Sub UploadOrderData(pickerId As String)
Dim pickerSendPath, pickerId, uploadFolder As String
Dim filesToSend, filesSent As List
uploadFolder = Starter.ftpFolder
pickerSendPath = $"/scan_app/${pickerId}/sent/"$
'GET FILES
filesToSend = File.ListFiles(uploadFolder)
If filesToSend.Size = 0 Then
Return
End If
filesSent.Initialize
If ftp.IsInitialized = False Then
ftp.Initialize("FTP", Starter.ftpServer, Starter.ftpPort, Starter.ftpUserName, Starter.FtpPassword)
ftp.PassiveMode = True
End If
ProgressDialogShow2("Bestanden versturen..", False)
Sleep(300)
Log($"FILES : ${filesToSend.Size}"$)
For i = 0 To filesToSend.Size - 1
Log(i)
Log($"FILE NAME : ${filesToSend.Get(i)} - ${pickerSendPath}${filesToSend.Get(i)}"$)
Dim sf As Object = ftp.UploadFile(uploadFolder, filesToSend.Get(i), False, $"${pickerSendPath}${filesToSend.Get(i)}"$)
Wait For (sf) FTP_UploadCompleted (ServerPath As String, Success As Boolean)
If Success Then
Log($"$Time{DateTime.now}"$)
filesSent.Add(filesToSend.Get(i))
Else
Log(LastException.Message)
End If
Next
ftp.Close
ProgressDialogHide
End Sub