New FTP library, Beta Tester Needed

margret

Well-Known Member
Licensed User
Longtime User
I have a new FTP library almost completed and need a Beta tester for testing this lib. It is very raw and almost no testing has been done. You will need to have B4A 2.52. If you are interested and can do some testing right away, please let me know.

This will be posted to the fourm once it has been tested/fixed, etc.

Thanks:D
 
Last edited:

margret

Well-Known Member
Licensed User
Longtime User
@walterf25,

Please feel free to post you issues and questions here in the forum. It may be better here to track the issues or questions.

Sample Code For Some Functions:
B4X:
   'Setup to use FTP
   Dim FTP As FTPClass
   FTP.Initialize(Activity, "ftp.yourdomain.com", "username", "password", 21, True)

   'to download a group of files
   FTP.FTP_ListFiles2(File.DirInternal & "/downloads", Array As String("firstfiles*.txt", "secondfiles*.doc", "thirdfiles*.bmp"), False)

   'to upload a group of files
   FTP.FTP_ListLocalFiles("test/files", Array As String(File.DirInternal&"/downloads/"&"first*.txt", File.DirInternal&"/downloads/"&"second*.txt", File.DirInternal&"/downloads/"&"third*.txt"))
   
   'to upload a single file
   FTP.FTP_UpLoadFile(File.DirInternal, "test/files/", "plane.jpg")

   'to download a single file
   FTP.FTP_DownLoadFile(File.DirInternal, "test/files/", "plane.jpg", False)

   'to see the last activity of uploads and downloads
   FTP.FTP_LastUploadStats
   FTP.FTP_LastDownloadStats
 
Upvote 0

walterf25

Expert
Licensed User
Longtime User
Ftp

Hi, i'm able to upload files, but i can't download any files from my ftp server to the phone, any ideas?

this is the images when i try to download a file

scrnshot1.jpg scrnshot2.jpg


this is my code
B4X:
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 FTPClass
Dim button1 As Button
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("1")
ftp.Initialize(Activity, "ftp.garagesale.vacau.com", "username", "password", 21, True)
ftp.FTP_UpLoadFile(File.DirRootExternal, "public_html", "frame0.jpg")

Sub Button1_Click
ftp.FTP_DownLoadFile(File.DirRootExternal, "public_html", "garage.php", False)   
End Sub
End Sub

let me know if you have any suggestions!
 
Upvote 0

walterf25

Expert
Licensed User
Longtime User
Ftp

Ok, tried that, and i get this message in the filtered logs

Downloaded: /public_html/public_html/garage.php, Success=false

why does it show two times the server folder "public_html/public_html"

seems like there's something not quiet working there!
 
Upvote 0

walterf25

Expert
Licensed User
Longtime User
Ftp

Ok, i tried the "" but it doesn't work either, I tried different things and i can't get it to download a file, have you gotten this part to work on your end?

For some reason i can't get it to work, any suggestions?
 
Upvote 0

walterf25

Expert
Licensed User
Longtime User
Ftp

Ok this works!
B4X:
ftp.FTP_DownLoad("public_html", "garage.php")

but i can't figure out where it downloads the file to.

i wonder why the other way it doesn't work

B4X:
ftp.FTP_DownLoadFile(File.DirRootExternal, "public_html/", "garage.php", False)


do you know where i should look for the file downloaded, i get the message in the filtered logs that the download was successful but i can't fine the file anywhere in the SD card.

:D
 
Upvote 0

walterf25

Expert
Licensed User
Longtime User
FTP Beta Test

Ok, i figured out a way that works for me, here's the code

B4X:
Sub Button1_Click
ftp.Initialize(Activity, "ftp.garagesale.vacau.com", "username", "password", 21, True)
'ftp.FTP_DownLoadFile(File.DirDefaultExternal, "", "garage.php", False)   this does not work
ftp.FTP_DownLoad("public_html", "garage.php")
File.Copy(File.DirInternal, "garage.php", File.DirDefaultExternal, "copied2.txt")
End Sub

So Basically when you use "ftp.FTP_Download("public_html", "garage.php") this file gets downloaded to the internal memory of the device, so you can then copy that file to the sd card directory.

hope this helps!

:)
 
Last edited:
Upvote 0

margret

Well-Known Member
Licensed User
Longtime User
Yes, I use this part of the lib daily. Try it as shown below and also see what the log shows. The first time it showed the folder name twice, I think is was because Public_html is the default folder and it was looking for a folder within the folder.

B4X:
ftp.FTP_DownLoadFile(File.DirRootExternal, "/", "garage.php", False)
 
Upvote 0

walterf25

Expert
Licensed User
Longtime User
FTP Beta Test

Ok i just tried what you suggested, but it still doesn't work, i only get a what looks like an input list but it says Files found and it doesn't show any files listed.

I wonder what's going on!
 
Upvote 0

walterf25

Expert
Licensed User
Longtime User
FTP Beta Test

I also just notice everytime i click on the Mask for Files dialog box and click on the "/garage.php" option i get this in the filtered logs

** Service (advancedwidget) Start **
No AppWidget Ids found!

Do you know why this is? It must be related to your library since it only happens when i run this app to test your library!
 
Upvote 0

margret

Well-Known Member
Licensed User
Longtime User
I just pulled this code out of my app yesterday to make this lib. I have been working and looking through this again this morning. What a mess I have made. I am working on the lib right now and fixing tons of things I have found wrong, I can't believe how bad it is. I am sorry. Give me just a little bit and I will get you a new lib put together and things should be much better.
 
Upvote 0

walterf25

Expert
Licensed User
Longtime User
FTP Beta Test

No worries, glad i could help testing, and i can't wait until you officially release it, my mind is already thinking of many things i can use this library on.

Cheers,
Walter
 
Upvote 0

sorex

Expert
Licensed User
Longtime User
I can try it on my phone (2.2) and on my tablet (4.x) if you want.

wasn't there already a library for ftp?
 
Upvote 0

margret

Well-Known Member
Licensed User
Longtime User
Let us get this first tier complete and then I will post one that you can try.

Yes there is already a FTP lib. This one will allow multi file names with multi masks all in the same process. This one will also have an overall progress bar and a progress bar for each single files status and is automated.
 
Last edited:
Upvote 0
Top