Android Question Correct way to test FTP connection?

barx

Well-Known Member
Licensed User
Longtime User
When using the FTP object in the Net library, what would be the correct / best way to test a connection. i.e. check the credentials are right for beginning transfers?

I thought of sending a 'List' request but would this fail if the directory was empty?

or maybe upload a dummy file. and delete it after checking for success.

Thanks
 

DonManfred

Expert
Licensed User
Longtime User
i think the best way is doing a chdir to / or something...
An empty directorylisting should work also...
 
Upvote 0

barx

Well-Known Member
Licensed User
Longtime User
How is that achieved?
Something like

B4X:
FTP.SendCommand("CHDIR", "/")

Thanks
 
Upvote 0

luciano deri

Active Member
Licensed User
Longtime User
When using the FTP object in the Net library, what would be the correct / best way to test a connection. i.e. check the credentials are right for beginning transfers?

I thought of sending a 'List' request but would this fail if the directory was empty?

or maybe upload a dummy file. and delete it after checking for success.

Thanks
What the solution of this question?
 
Upvote 0
Top