B4A Library Automated FTP Library

HDSInformatics

Member
Licensed User
Longtime User
Hi Michael,

With the latest lib version (thanks again Margret), everything works perfectly, the library is very simple/fast to use and helped me a lot with the simplification of sending/receiving files to/from FTP server. again :wav:

Oh god... I wrote the wrong thing. I said it's in the NET library and not in the FTP_auto library but it's the other way around...
Pardon me
 

cjolly

Member
Licensed User
Longtime User
problem with UsePassiveMode

Hi Margret,

Apparently, the definition of UsePassiveMode (Initialize) is not working properly, always in active mode (sending by port 21 and waiting on port 20), can you verify please. :sign0085:

*TIA*
 

cjolly

Member
Licensed User
Longtime User
The code is there to support this, it could of been the order the commands where called. I changed that. Before I update post #1, can you please check the attached lib and see if it's working now.

Thanks

Genius, now pasive and active works ok in FTP_Auto

The bad new is the NET library has the same problem, maybe somebody can check this before report a bug? NO ERROR IT'S OK :sign0013:

Thanks again
 
Last edited:

cjolly

Member
Licensed User
Longtime User
Margret,

FTP_Auto can be used as a service?

If YES, how?
 

upsis

Member
Licensed User
Longtime User
Wish list

Congratulations, excelent library. I suggest a command to check if file exists in server.
 

Smee

Well-Known Member
Licensed User
Longtime User
Hi Margret,

I have not used this library as yet but looking forward to trying. I have previously used the net lib for ftp and used tricks to get around the 20 file synchrounous download limit, Is there any limit with this lib? Can i just use an array list or for next loop to download an unknown number of files?

Thanks for your contributions

Joe

UPDATE:

I tried the lib with one file

B4X:
FTP1.Initialize(Activity,Me,"www.xxx.com","xxxxxx","xxxxxx",21,False,False)
FTP1.SetProcessCompleteOn(True)
FTP1.SetStealthOn(True)
FTP1.DownLoadFile(File.DirRootExternal,"Jpegs/","635742_100.jpg",False)

The file downloads fine, however i still see the download box with progress bars. also the following sub does not fire

B4X:
Sub FTP1_ProcessComplete
Log("Complete")
End Sub
 
Last edited:

Smee

Well-Known Member
Licensed User
Longtime User
Thanks for the reply margret,

Using the latest lib. I am also using the NET library for SMS messages, that is why i changed the Dim FTP1 As FTP_Auto.

i think FTP is a reserved word when the net lib is in use, is this not correct?

Thanks

Update:

i changed the code to
B4X:
Sub ftpDownload

FTP.Initialize(Activity,Me,"xx","xx","xx",21,False,False)
FTP.SetStealthOn(True)
FTP.SetProcessCompleteOn(True)
FTP.DownLoadFile(File.DirRootExternal,"635742_100.jpg",False)
End Sub

and the Sub FTP_ProcessComplete fires correctly now, however the download box still appears
 
Last edited:

margret

Well-Known Member
Licensed User
Longtime User
The FTP is reserved if used like FTP.something, but when using it with a continued name like: FTP_ProcessComplete, this is not a problem.

As for the Stealth mode not working, that is strange. I have looked at the code and tested it again and this works fine in my app. One thing, I have another panel or layout loaded. Do you have anything in your activity or is it just the FTP code? It may be some issue with it being the only dialog in the activity. Also, what version of Android are you using this on because you are the only one that has reported this issue and I want to make sure I get it fixed. Also, if you can, it would help to see your code.

You also can have Dim FTP1 as FTP_Auto and the sub name would still need to be FTP_ProcessComplete. FTP_ProcessComplete is the sub name the library looks for, it has nothing to do with what you Dim as FTP_Auto. You could have: Dim Jimmy As FTP_Auto and it will still look for: FTP_ProcessComplete. Hope this helps make this clearer. As long as the sub FTP_ProcessComplete is there it will be called and you can Dim anything you like as FTP_Auto.
 
Last edited:

Smee

Well-Known Member
Licensed User
Longtime User
Thx Margret,

I called the code very early in the program to test so it may well be because other items have not been loaded properly.
I will do some further testing and if i cannot get it right i will send you the code. Incidentally it is on a Note II.

I am using ver 2.5
 

Smee

Well-Known Member
Licensed User
Longtime User
ok i used a timer to call the ftp download and i still get the display.



B4X:
Dim FTP As FTP_Auto

Sub Timer2_Tick
ftpDownload

Timer2.Enabled=False
End Sub


Sub ftpDownload
FTP.Initialize(Activity,Me,"xxx","xxx","xxx",21,False,False)
If FTP.WiFi_IsConnected=False Then Return

FTP.SetProcessCompleteOn(True)
FTP.SetStealthOn(True)
FTP.DownLoadFile(File.DirRootExternal,"/Jpegs/","*.jpg",False)
End Sub

Sub FTP_ProcessComplete
'Your code here...
Log("Complete")
End Sub
 

Attachments

  • screenshot.jpg
    24.7 KB · Views: 230

Smee

Well-Known Member
Licensed User
Longtime User
Margret,

I tried with the AHViewPager example and added the code routines to the example and i get the same result. i also tried it with a very small sample program called guess my number and i get the same result.

It could be a NOTE 2 thing?

Android SDK ver 2.2
 
Last edited:

doncx

Active Member
Licensed User
Longtime User
Progress ; the user interface

Margret -

Your library works fabulously and effortlessly. Thank you very much for sharing.

I'm trying to improve the user interface and am unable to change the size of the progress display, which appears *very* small on tablets, so much so that the words don't fit correctly.

Is there a way to size the progress panel?

Alternatively, is there a way to access the actual progress to build a custom progress interface?

Thanks,

- Don
 

Smee

Well-Known Member
Licensed User
Longtime User
If you want to export a test project that shows this issue, I will see if I can find and fix the issue.

Here you go. i am starting to think that it might be an issue with the NoteII

Hopefully this can be a simple fix because i am not REQUIRED to show a dialogue in this particular app.

Thanks again
 

Attachments

  • Test FTP.zip
    6.9 KB · Views: 231
Last edited:

Smee

Well-Known Member
Licensed User
Longtime User
EXCELLENT Margret. It works great now. Thanks very much for your efforts and your library. :sign0060::sign0060::sign0060::sign0098:

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