Want a quick introduction? Just watch the video above!

Contents

  1. Introduction
  2. The New Flutter File Share App
  3. Using the App
  4. Advanced Features
  5. Disabled Features on Mobile
  6. Downloads and Source Code
  7. Apply to be a Beta Tester

Introduction

The Pafera File Server Running in Android Termux

Last year, I released an utility called the Pafera File Server. It's a console app written in Rust that runs a web-based file manager for your devices, allowing easy file sharing to anything that has a web browser with a handy slide show feature to show off your photos and shiba icons. This means that you can go to a party and let 200 friends all browse your recent vacation photos on their own phones, at their own time and pace.

Later, as various suggestions and usage patterns came in from friends and random internet strangers, I started adding more and more features. It's now capable of rsyncing entire directory trees, transcoding media files, opening files with native operating system apps, and automatically syncing files across your devices.

However, being a console app, there was always one big problem that prevented it from being a universal solution for all of your devices:

Console apps can't run on iOS, meaning you couldn't run the Pafera File Server on iPhones nor iPads...

Until now.

The New Flutter File Share App

I had some spare time over Christmas break while Montenegro was celebrating the holidays, so I experimented with writing a multiplatform companion app in Flutter/Dart that would allow you to easily browse servers from your phone. That way, my less tech-inclined friends could just push two buttons and connect to my servers.

Along the way, I figured out that you could actually use Dart to run your own web server on iOS devices, and I thought...

Hey! Why don't I just implement the file server in Dart instead!

So two weeks later, the app is here.

The Pafera File Server Running on iPhone

Now, performance is dreadfully slow compared to the Rust version. The Rust server can serve about 40,000 requests per second...

While the Dart version can serve only about 400....

But the important thing is that it works...

and it installs on iPhones!

Using the App

Due to a bug in the PDFx library with recent versions of Flutter, I've had to stop using pretty icons for all of the buttons since they were showing up as ugly black lines.

However, the basic operation remains the same.

Basic operation

Once everyone's connected to the same WiFi network or your phone's hotspot, just click on the app icon, choose the folder that you want to share, and tap "Start Server".

Then click on the QR code button, let your friends scan it, and then they can happily browse your folder on their phones, even streaming movies from your phone directly to their phones.

If your friend is using a laptop or desktop computer, that's no problem either. Just type in the URL shown above the QR code on their device, and they can do the exact same thing.

If you're not running on iOS or Android, that's no problem either. Flutter Apps work on OSX, Windows, and Linux just fine, so you will get the same functionality, and even more if you install rsync, FFMpeg, and ImageMagick on your system for the app to use.

Advanced Features

There are quite a few advanced features besides simple file sharing, so I'll give a quick overview here.

Hostname is what shows to other devices when they click on "Search for other servers". You can use it to quickly distinguish one device from another if you're sharing a couple of devices at the same time.

Folder is the filesystem folder that you're actually sharing. You can click "Use documents folder" for the default in Documents/shared, or you can click "Choose folder" to pick another folder. You might also need to click on "Use documents folder" if iOS doesn't properly refresh the app's settings when resuming from sleep.

Use current IP automatically detects your device's current WiFi IP. As with "Use documents folder," use it if iOS doesn't refresh the app properly and it's still using an IP from a previous WiFi network.

"Share on all interfaces" sets the public IP to 0.0.0.0, which means that everyone on anything that you're connected to will be able to see your server. Handy on desktops with more than one connection, but be careful using it in public places.

"Start Sharing" will run the server and open the homepage for you to manage. Clicking it again will stop the server and keep your files safe.

"Load last settings" and "Save current settings" do exactly what they say. Your settings will be stored in Documents/paferafileserver.cfg just like the console Rust version.

Advanced options

The various password options are there to give different people different levels of access.

Normally, everyone can see your files just by connecting to your server, but if you check "Enable private files" below these, then no one will be able to see your files without the read password.

The write password is used to upload, move, copy, or delete files. Without this, no one else can do anything to your system besides view your files.

The shell password is useless on the mobile app, but is very useful on desktop operating systems and Termux on Android. It lets you run arbitary system commands, which make it very powerful and very dangerous at the same time. This feature is disabled by default, and you must both enter a shell password and check "Enable shell commands" below to use it.

The various enable and disable options let you choose what other people can do to your system even when they already have the right password. These override all other options, so if you disable copying files, no one - not even you yourself - will be able to copy files.

The special option "Disable SSH Keycheck" is for people like me who constantly roam around while syncing files back and forth between different devices. Normally, SSH will ask for confirmation when connecting to a system whose IP address has changed, even if that system's identity is already known. This option will enable you to automatically sync files on different networks without dropping down into the console to confirm SSH connections. Use it with care when on networks that you don't control yourself.

Disabled Features on Mobile

Unlike running in Termux or a desktop environment, the iOS and Android apps do not have access to a shell, rsync, ImageMagick, or FFMpeg, so all of the advanced syncing and transcoding features are disabled.

Because mobile operating systems can kill background apps at any time, timed automatic tasks are also disabled.

There are possible workarounds for all of these aspects, but the time required to integrate these features is beyond my intent at the moment. If someone is interested in paying me to add them, then we'll see what happens. 😁

Downloads and Source Code

As with all of my projects, the source code is hosted on Codeberg and can be found here.

For precompiled binaries, you may browse the release directory here...

Or simply click the links below:

Due to Apple signing requirements, iOS and OSX users must wait for the app to be available on the App Store, or download the source code and compile your own version for your devices.

Apply to be a Beta Tester

As this is a new release, I'm sure that there will be plenty of bugs and strange behavior on various systems. If you would like to beta test this app for me, please send me an email with your device and operating system version and I'll get you setup on TestFlight.

Distributing a Flutter app is actually much more complicated than the Rust version, where I just upload a single executable and be done with the whole thing, so please be understanding when it takes three weeks for Apple to check my app and allow it into the iOS App Store. Things should be much easier when Apple is required to allow third party apps as per the EU ruling.

As always, I hope that you guys find this app useful, and if you want to customize it for your own purposes, I'm always available as a technical consultant. Have fun!


About the Author

Jim has been programming since he got an IBM PS/2 back during the 90s. To this day, he still prefers writing HTML and SQL by hand, and focuses on efficiency and correctness in his work.