B4A Library Automated FTP Library

margret

Well-Known Member
Licensed User
Longtime User
I think it should run on version 2.71. However, you will need to make sure you have the Network and Net libraries in your library folders. If both of these libs are not there it will not run. You do NOT need to select them in the LIBS tab, but they should be in one of your library folders that configure paths are pointing to. Also, a sample project is now attached to post one but it was written with B4A 3.2. It will not run on the older version but you can open it and see the code needed to use the library.
 

sultan87

Active Member
Licensed User
Longtime User
Hello,
thank you
I download and I try
Best regards
 

sultan87

Active Member
Licensed User
Longtime User
Hello,
thank you
I download and I try
Best regards
Hello,

with my version 2.71 , I have problems

Parsing code. 0.03
Compiling code. Error
Une exception de type 'System.OutOfMemoryException' a été levée.

it should upgrade to the latest version?

best regards
 

GMan

Well-Known Member
Licensed User
Longtime User
System.OutOfMemoryException
Regarding to the error message it seems that you have some memory problems...too much libs included ?
 

margret

Well-Known Member
Licensed User
Longtime User
Hello,

with my version 2.71 , I have problems

Parsing code. 0.03
Compiling code. Error
Une exception de type 'System.OutOfMemoryException' a été levée.

it should upgrade to the latest version?

best regards

If you are talking about the sample app, if you create a new project and then copy & paste the code to the new project it should then run other than the layout files. If you are saying the that error is from the use of the library in 2.71, I will need to check this. Which one are you talking about, the Sample or the Library?
 

sultan87

Active Member
Licensed User
Longtime User
Hello,
I have bd on a ftp and I have a copy of this bd local. I want to download only if the date of the maj bd on the ftp is greater than the date of my local db maj.

Maj_Bd_Locale = File.LastModified(MyPath & "Bridge/Bases de Donnees/","bridge_donnes.db")
Maj_Bd_Distante = ????

how?
 

Witold Giejsztowt

New Member
Licensed User
Longtime User
Hi new guy here,

I try to solve my problem of copying /not to big/ file from tablet to PC server using FTP_auto library.
I have to:

1 FTP.UpLoadFile to server
2 On FTP_ProcessComplete sub start FTP.DownLoadFile just uploaded file
3 Then on source tablet I am comparing file I send in step 1 to file I got in step 2 deleting source file from tablet if they are identical.
My problem is that step 1 is no problem, step 2 is no problem, but then the same FTP_ProcessComplete sub starts step 2 again and again...

My code is based on code from #53 post
How to prevent reinitialising FTP_ProcessComplet sub?
 
Last edited:

margret

Well-Known Member
Licensed User
Longtime User
You will need to set a flag variable for each process. Put the code needed for each inside the ProcessComplete Sub. Something like:

B4X:
Sub Globals
    'Set this string to Upload or Download before each operation. That way
    'FTP_ProcessComplete will know which block of code to run
    Dim FTP_Flag As String = ""
End Sub
Sub FTP_ProcessComplete
    If FTP_Flag = "Upload" Then        'Upload completed
        'Your code here
    End If
    If FTP_Flag = "Download" Then    'Download completed
        'Your code here
    End If
End Sub
 

sultan87

Active Member
Licensed User
Longtime User
I don't have any provision for this now. But if you can give me a few days, I will look into adding this feature.
Hello Margret
FTP.initialize shows the upload dialog box
how to not display it?
I want to show dialog boxes Download / Upload only when you execute FTP.Download gold FTP.Upload
best regards
 

sultan87

Active Member
Licensed User
Longtime User
I don't have any provision for this now. But if you can give me a few days, I will look into adding this feature.
Hello Margret
I always
when I run "ftp.download ", I get this message appears in the log "to sending the message waiting queue (ftp_listcompleted)."
App seems to be stopped
why?
best regards
 

sultan87

Active Member
Licensed User
Longtime User
Try to set the last parameter in the initialize command to True, or if it's true now, set it to False. You can SetStealthOn at the start and turn it off right before the upload or download.
Attached is a test
whatever combinations, the dialog is always displayed
why?



B4X:
Region Module Attributes
   #FullScreen: False
   #IncludeTitle: True
   #ApplicationLabel: Test FTP Auto
   #VersionCode: 1
   #VersionName:
   #SupportedOrientations: unspecified
   #CanInstallToExternalStorage: False
#End Region

'Activity module
Sub Process_Globals
   'These global variables will be declared once when the application starts.
   'These variables can be accessed from all modules.

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.

   Dim FTP As FTP_Auto
'   FTP.Initialize(Activity, Me, "ftpperso.free.fr", "pmc.ftp", "soline", 21, True, False)
   
End Sub

Sub Activity_Create(FirstTime As Boolean)

'' essai 1
'   FTP.SetStealthOn(False)
'   FTP.Initialize(Activity, Me, "ftpperso.free.fr", "pmc.ftp", "xxxx", 21, False, False)

'' essai 2
'   FTP.SetStealthOn(False)
'   FTP.Initialize(Activity, Me, "ftpperso.free.fr", "pmc.ftp", "xxxx", 21, False, True)
'
'' essai 3
'   FTP.SetStealthOn(True)
'   FTP.Initialize(Activity, Me, "ftpperso.free.fr", "pmc.ftp", "xxxx", 21, False, False)
'
' essai 4
   FTP.SetStealthOn(True)
   FTP.Initialize(Activity, Me, "ftpperso.free.fr", "pmc.ftp", "xxxx", 21, False, True)

End Sub

Sub Activity_Resume
End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub

best regards
 

sultan87

Active Member
Licensed User
Longtime User
You need to Initialize first and then SetStealthOn.
I tried as agreed, same problem
B4X:
Sub Activity_Create(FirstTime As Boolean)

'' essai 1
'   FTP.Initialize(Activity, Me, "ftpperso.free.fr", "pmc.ftp", "xxxx", 21, False, False)
'   FTP.SetStealthOn(False)

'' essai 2
'   FTP.Initialize(Activity, Me, "ftpperso.free.fr", "pmc.ftp", "xxxx", 21, False, True)
'   FTP.SetStealthOn(False)
'
'' essai 3
'   FTP.Initialize(Activity, Me, "ftpperso.free.fr", "pmc.ftp", "xxxx", 21, False, False)
'   FTP.SetStealthOn(True)
'
' essai 4
   FTP.Initialize(Activity, Me, "ftpperso.free.fr", "pmc.ftp", "xxxx", 21, False, True)
   FTP.SetStealthOn(True)

End Sub
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…