B4A Library Tiny FTP Server as Class

Hello,
I created a tiny FTP server implemented as a class to use in B4A apps. The source and an example project is attached.

Why ???

Several of my projects allow the user to add files containing a word list or database records to the app's directory. These are imported and used within the app. Currently I tell people install a third-party FTP, connect using a client on a PC, navigate to my app's directory, and transfer the file. That seems to be a little too much to ask.

Embedding the tiny FTP server into an app allows the user to invoke the FTP using a button or menu item within the app, connect from a PC, and transfer the file directly to the proper directory. Maybe this will be a little easier.

The tiny FTP server is limited in that you cannot change your working directory and I have not implemented all the FTP commands.

At the bottom of the TinyFTPSvr.bas file there are a couple handy utilities: Sprintf - similar to the C function, and FormatDateTime - similar to the Delphi function.

For convenience I have included in the attached zip file the set of utilities, DateUtils.bas, created by Erel.

Barry.
 

Attachments

  • MyFTP.zip
    38.5 KB · Views: 558
Last edited:

canalrun

Well-Known Member
Licensed User
Longtime User
My guess would be that Filezilla is sending some command that is not supported, times out with no response, closes the socket.

Tiny FTP only supports the barest of minimum FTP commands. I was able to use it with CuteFTP (also free).

You may be able to insert Log statements in the B4A code to see if you are getting some command that is not supported.

I am far from an FTP expert. I can't help much toward explaining what should or should not be supported or what errors will be generated.

Barry.
 
Top