Android Question FTP_ProgressionDownload Funny

Fabrice La

Active Member
Licensed User
Longtime User
I have something funny append.
I am using FTP and download file size of 14 Mb

When i run FTPflcc.DownloadFile("share/" & filetoDownload,True,fullpath2, filetoDownload)

in FTP_ProgressionDownload I log :
Dim s As String
s = "Downloaded " & Round(TotalDownloaded / 1000) & "KB"
Dim sizeFileL As Long
sizeFileL = sizeFile.Text + 0
If sizeFileL > 0 Then s = s & " out of " & Round(sizeFileL / 1000) & "KB"
Log(s)
DoEvents

and go for ever and never finish (in the ftp server the file is downloaded in 2mn) with :

 

Fabrice La

Active Member
Licensed User
Longtime User
No I don't move the tablet and it's in click Button not on activity_resume or *_created

It does the same in Upload keep in progress for ages .....
 
Last edited:
Upvote 0

Fabrice La

Active Member
Licensed User
Longtime User
My code

B4X:
#Region  Project Attributes
    #ApplicationLabel: B4A Example
    #VersionCode: 1
    #VersionName:
    'SupportedOrientations possible values: unspecified, landscape or portrait.
    #SupportedOrientations: unspecified
    #CanInstallToExternalStorage: False
#End Region

#Region  Activity Attributes
    #FullScreen: False
    #IncludeTitle: True
#End Region

Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.
    Dim FTPflcc As FTP
End Sub

Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.

End Sub

Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    'Activity.LoadLayout("Layout1")
    Activity.LoadLayout("Main")
    If FirstTime Then
   
    End If
    If FTPflcc.IsInitialized = False Then FTPflcc.Initialize("FTP","10.230.52.181",21,"login","Password")
    ProgressDialogShow("Uploading " & "..." & ", please wait...")
    FTPflcc.UploadFile(File.DirRootExternal & "/share/","Divers" & ".zip",False,"/share/" & "Divers" & ".zip")
End Sub
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)
    DoEvents
End Sub
Sub FTP_UploadCompleted (ServerPath As String, Success As Boolean)
    Log(ServerPath & ", Success=" & Success)
    If Success = False Then Log(LastException.Message)
    Msgbox("Export, Success=" & Success, ServerPath)
    ProgressDialogHide
    FTPflcc.Close
End Sub
Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub

Can someOne try it ....
I am using Filezila Server and the file to upload is 14Mb size
 
Upvote 0

Fabrice La

Active Member
Licensed User
Longtime User
I am using the "Automated FTP Library" and solve problems.

I am using both with "Net library" because "Automated FTP Library" need some feature

But my appli is working now ...
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…