Android Question FTP a network file?

jeronimovilar

Member
Licensed User
is it possible to put (ftp) a net file using Android?
example:
B4X:
ftp.Initialize("ftp", "your.server", 21, "user", "password")
ftp.UploadFile("\\192.168.0.100\folder", "somefile", False, "/somefile")
 

DonManfred

Expert
Licensed User
ftp.UploadFile("\\192.168.0.100\folder", "somefile", False, "/somefile")
Probably no.
- As the \\path is a Networkpath you need to access this path using SMB library first (the FTP Library does not have access to any SMB Resource).
- Download the fileto your device
- and then you can upload it to FTP.

If the SMB Library is not working for you as you need to use SMB 2 Protocol: You can try my jcifs-ng Library.
 

Erel

Administrator
Staff member
Licensed User
I'm afraid that I don't understand the question in this thread. You can use the FTP library to upload files to any FTP server.
 

jeronimovilar

Member
Licensed User
- my app is on smart and tablet
- connect to my FTP server is ok.
- the PC and the smart/tablet is on INTRANET
- the FTP server is on INTERNET
- If my file on smart to upload is ok, but...
but i need to upload a file that is on PC (\\192.168.0.10\folder shared\file.txt) to FTP Server (177.55.116.184) using my android app.
B4X:
ftp.Initialize("ftp", "177.155.116.184", 21, "user", "password")
ftp.UploadFile("\\192.168.0.100\FolderShared", "somefile", False, "/somefile")
is it clear?
 

Erel

Administrator
Staff member
Licensed User
Yes. DonManfred answer is the correct answer. You need to first download the file from the PC. You can do it with SMB or by running a FTP server on the PC.
 

DonManfred

Expert
Licensed User
You should start a new thread for any new question.
Additionally you should check the available example first.
 
Top