Android Question Net Library - FTP_UploadProgress....

RichardN

Well-Known Member
Licensed User
Longtime User
Anybody noticed a problem with this...

B4X:
Sub FTP_UploadProgress (ServerPath As String, TotalUploaded As Long, Total As Long)
        
    ProgressBar1.Progress = TotalUploaded/Total *100
    
End Sub

The Long variable 'Total' always seems to return -1 whatever the file size. I tried PassiveMode True/False but no change. Is this a bug?
 

DonManfred

Expert
Licensed User
Longtime User
He´s talking about UPLOAD
 
Upvote 0

RichardN

Well-Known Member
Licensed User
Longtime User
I see. Thankfully the workaround is fairly simple...

B4X:
.....
Dim UploadFileSize As Long  = File.Size(MyFilePath,MyFile)
.....

Sub FTP_UploadProgress (ServerPath As String, TotalUploaded As Long, Total As Long)
     
    'varTotal is corrupt use UploadFileSize instead

    ProgressBar1.Progress = TotalUploaded/UploadFileSize *100
    
End Sub
 
Upvote 0
Top