Feature

Easy File Sharing

How to run a local FTP server on a ‘surplus’ mobile phone.

Tom Hartley

Issue 59, June 2022

Thanks to Cloud storage, transferring files between computers and other devices in the home, including mobile phones and tablets can usually be made conveniently. If Cloud storage access isn’t an option though, we usually find ourselves using cumbersome file transfer methods such as USB thumbdrives, portable hard drives, etc. Or, we resort to sending files via email or messaging app, which is common to transfer files to a device that doesn’t have a USB port or requires various adaptors to do so.

This is where a local FTP server can make file transfer much easier between devices in the home. Electronics enthusiast, Tom Hartley, got in touch with us to share his FTP server solution that uses a surplus Android phone. We caught up with Tom to learn more, and we’re delighted that Tom shared instructions so that you can set up one for yourself.

Thanks for your time, Tom. Please tell our readers a little about yourself and what got you first interested in electronics?

I am a retired Clinical Biochemist (Royal Hobart Hospital) and retired Senior Research Fellow School of Human Life Sciences (University of Tasmania)

I first got into electronics when I was a boy... built short wave radios with the help of my father. As a young research scientist I got into programming first with Algol, then BASIC and some C. Most programs were scientific in nature and related to my work. Operating systems included CPM, Z80 Sinclair, MSDOS, Windows up to version 10 and now currently I am running Linux Mint 19 and Android 10.

You’re bringing back some fond memories. What motivated you to make your own FTP Server using a smartphone?

Most people don't realise that their mobile phone is in fact a very powerful computer. There are some amazingly powerful Apps available to scientists like myself plus I have even ventured into writing Apps using MIT/Ai2 App Inventor.

The idea of setting up an FTP server on an Android phone came about because I found myself using different devices around the home and workshop and constantly running into the need to make what I had just written or found on the internet had to be taken further ... but not on that device at that location and at that time. Hence there was a real need for a file sharing resource. The spare phone fitted the bill and the range of its WiFi turned out to be more than adequate.

That's a great idea to repurpose a phone. We’re sure many of our readers have a smartphone laying about. We assume this is why you got in touch with us so that you could share your knowledge with other makers?

The FTPserver App came with no instructions as to how to set it up but my previous knowledge and use of FTP servers across the internet put me in a good position to 'nut' it out. I feel like sharing this knowledge because it is confusing to the novice .... they need to get their head around which device is the 'host' and which is the 'client' and how these have to connect to each other via a 'router'.

You mentioned you are using an Android phone. Do you know if it will work on iOS?

It works with any Android phone running Version 4 or higher. I am not sure about it working on an iPhone.

Are you aware of any security issues using this method?

No real security issues. WiFi range is modest so snooping would be very hit and miss. The greatest risk would be to physically lose the FTP Server phone so the best protection against that would be to password protect that phone as per usual Android phone recommendations.

Good advice. If our readers want to set up one for themselves, how should they proceed?

I have supplied the full details for your readers.

Thank you. We have added the build to the end of this article. Is there anything else that we have not discussed that our readers should know about the project?

The solution is probably not suited to too many multiple users. WiFI hotspots on Android phones have a limit on the number of concurrent connections. I would anticipate that the set-up I have described would work best within a smallish work group of up to say 5 people but I have not tested it at that level.

Thank you for sharing your project with our readers, Tom.

The Build: Setting up an FTP server on a mobile phone

Why would you find a FTP Server useful?

Remember how many times you are on your usual mobile phone, tablet or desktop PC and you come across an item that you would like to work on further on another device located elsewhere. If you have cloud drive access while on the current device, then you can save it to the cloud and then pull it down onto your device at another location at a later time. But if you don’t have a cloud storage account, or for some reason it is not available to you at that location, then your only other option is to save it to some sort of local memory device such as a SD card if its a phone or tablet, or to a USB drive if it is a desktop PC. Then, when is next convenient, plug that phone or USB drive into your desktop PC’s USB port and go searching for that file and copy it across. This is fiddly, and unless you are particularly well disciplined, you will probably have times when you cannot remember exactly what you called that file and/or where you stored that file! And, if you are wanting to transfer it to another phone or device that has no USB port option, then it gets really fiddly and you’ll probably resort to using the attachment options in your email or messaging accounts to move it over.

This is where this local FTP Server solution comes to your aid. If you have an android phone running Android 4 or higher, and that you are no longer using, then it can be turned into a local FTP Server very easily. The design concept is as follows.

  • Tiny FTP Server App runs on "old" Android Phone with SD Card
  • The "old" Android Phone runs WiFi so that it can communicate bi-directionally to FTP Clients
  • Those FTP clients have to connect to the same via WiFi Hotspot on another Android Phone or a conventional WiFi Router (covered in the Using a Wireless Router step).

HOT SPOT PHONE

Turn on the hot spot.

Note: This assumes that you have already used this functionality on this phone. If not then you can find the options under Settings – More – Tethering and portable hotspot.

If you would prefer to use a wireless router, skip to the Using a Wireless Router step.

FTP SERVER PHONE

Initial setup

Open up the File Manager App on the phone and create a directory call SHARES on either the internal phone’s memory or on a SD card that you have previously inserted into this phone.

Install the Tiny Webserver app from Google Play:

https://play.google.com/store/apps/details?id=ar.com.lrusso.tinywebserver

Start the server and assign it a unique Name and a Password. You will also need to assign the Server path at this point. Because Android uses a Unix style of directory structure and directory naming, it is unfamiliar territory for most Windows users. If you have created the SHARES directory at the first step in this section inside the phone’s internal memory, then you will find that under /storage/sdcard1. If you have created it in the SD card you have inserted into this phone, then you will find that under /storage/sdcard0.

With the correct directory for your setup highlighted tap CHANGE. The screen should look like that in Figure 1.

Fig 1: Tiny FTP Server screen display once it has been fully configured by the user.

Turn on WiFi.

Connect it to the Hot Spot Phone via Android ‘Settings’ by entering the correct password for the Hotspot Phone.

DAY TO DAY RUNNING OF FTP SERVER PHONE

Turn WiFi on.

Start the Tiny FTP Server App.

Leave it for a few minutes. During this time the Tiny FTP Server will negotiate an IP address from the Hot Spot phone. You will see that has been successful when it changes from a default value that often looks like 127.0.0.1:2121 to something more believable like 192.168.43.218:2121. The digits 2121 correspond to the Port Number that the Tiny FTP Server is using for communications with all its external FTP Clients.

Fig 2: File Manager + showing the IP address of the FTP Server phone.

CONNECTING ANOTHER MOBILE PHONE TO THE FTP SERVER PHONE

Turn WiFi on and allow to connect the Hotspot Phone.

Note: This assumes that you have already used this functionality on this phone. If not, then you can find the options under Settings – WiFi – Your Hotspot Phone’s Name. Here it will ask to create a password for that Hotspot.

Open the File Manager + App. On the first screen, you will see a folder called Remote. Open that folder and you should see the IP Address that corresponds to the IP Address of the Tiny FTP Server that appeared in the previous step (see Figure 2).

Click on that IP Address. You should then be able to see all the directories on the Tiny FTP Server’s phone, starting at the level of the one that you created in the previous steps and called SHARES.

To move files to and from any location on the client phone to the SHARES directory on the FTP Server phone, use exactly the same procedures that you normally use with File Manager +.

Important Note: File Manager + is the recommended App to use on any client Android phone that you intend to use in this setup because it has this very useful Remote folder facility.

https://play.google.com/store/apps/details?id=com.alphainventor.filemanager

If you do not wish to use this App then you will have to search out a FTP Client App that best suits your needs and preferences.

CONNECTING A PC TO THE FTP SERVER PHONE

The procedure is exactly the same as you would follow with any other FTP Server. The recommended FTP client software for Windows is CuteFTP:

https://download.cnet.com/CuteFTP/3000-2160_4-10000625.html

and for Linux File Zilla:

https://filezilla-project.org/download.php

USING A WIRELESS ROUTER

The author uses mobile broadband so has dispensed with using mains powered routers and uses mobile hotspots instead. However, if you wish to use a wireless router then the procedure is straightforward. Gather the following from the notes that you hopefully made when you set your router up. i.e. its network name and password.

Turn the router on. Turn on the ‘wireless’ function on the Tiny FTP Server phone. Search for that network name and login. Now go back to the FTP SERVER PHONE step and continue.