Hi, here is my code.
I'm using b4a version 9.50 with Net Library 1.8 in default folder.
[CODE lang="b4x" title="FTP.Upload multiple files" highlight="13-20"]For i =0 To Qty-1
Cursor1.Position=i
FileName=Cursor1.GetString("VoiceMessageFileName")
If FileName<>"" Then
If File.Exists(File.DirRootExternal,FileName) Then
RecordID=Cursor1.GetInt("ID")
Dim sf As Object =FTP.UploadFile(File.DirRootExternal, FileName, False, FileName)
Wait For (sf) FTP_UploadCompleted (ServerPath As String, Success As Boolean)
If Success Then
Log("VM file was uploaded successfully")
Else
Log("Error uploading VM file")
End If
End If
End If
Next[/CODE]
Here is my compilation error
B4A Version: 9.50
Java Version: 8
Parsing code. (0.13s)
Building folders structure. (0.02s)
Compiling code. (0.24s)
Compiling layouts code. (0.02s)
Organizing libraries. (0.00s)
(AndroidX SDK)
Generating R file. (0.00s)
Compiling debugger engine code. (1.74s)
Compiling generated Java code. Error
B4A line: 546
Dim sf As Object =FTP.UploadFile(File.DirRoot
javac 1.8.0_40
src\alex\HCMS\Timesheet\nursenotesnew.java:1324: error: incompatible types: void cannot be converted to Object
_sf = parent._ftp.UploadFile(processBA,anywheresoftware.b4a.keywords.Common.File.getDirRootExternal(),parent.mostCurrent._filename,anywheresoftware.b4a.keywords.Common.False,parent.mostCurrent._filename);
^
If I use this code
[CODE lang="b4x" title="FTP.Upload multiple files without wait" highlight="22,23"]For i =0 To Qty-1
Cursor1.Position=i
FileName=Cursor1.GetString("VoiceMessageFileName")
If FileName<>"" Then
If File.Exists(File.DirRootExternal,FileName) Then
RecordID=Cursor1.GetInt("ID")
'Dim sf As Object =FTP.UploadFile(File.DirRootExternal, FileName, False, FileName)
'Wait For (sf) FTP_UploadCompleted (ServerPath As String, Success As Boolean)
'If Success Then
' Log("VM file was uploaded successfully")
'Else
' Log("Error uploading VM file")
'End If
FTP.UploadFile(File.DirRootExternal, FileName, False, FileName)
Sleep(4000)
End If
End If
Next[/CODE]
compilation works fine without error.
Please advise.
Thanks