Python Flask multiple file upload web app
What’s the saying? “Necessity is the mother of invention.” Maybe in this case, “necessity is the mother of DIY.” I invented absolutely nothing. I merely became so fed-up with (i) looking for my phone’s USB cable when I need it, or (ii) relying on sub-par file transfer applications, that I have finally fixed my problem. I only need to move files (usually photos) from my phone to my PC. How hard is this to do in the 21st century, for Pete’s sake!
I’ve tried them all over the years: cloud storage, LocalSend, Warpinator…the list is long, much longer than just those three. And eventually, they all fail. Like my trusty USB cable, they are sometimes not found when I need them.
LocalSend is loved by millions but I’ve always found it to be very sporadic and unreliable. It sometimes works, it sometimes doesn’t. The same goes for Warpinator, which has always just performed badly on my Android phone. When cloud storage was vogue, I used that but it’s not something I’m ever doing again. Besides, Phone > Cloud > PC is one hop too many; I want simple Point A to Point B transfers. Usually, it is from my phone to my PC, and very rarely the other way. When I do need to move files from the PC to the phone, I’m happy to dig out the USB cable, which is maybe once a year, if that.
Using Python’s Flask
There’s really no place like 127.0.0.1. I spin up a Flask server web app on my PC and can transfer multiple files all at once from my phone to a specific directory on my PC. That is all this does. The interface is intentionally ugly. It has one job to do; there is absolutely no need to get dressed and look sharp. I will eventually get around to putting some makeup on this ugly duckling.
With Firefox on my phone, I can pin a shortcut to the start page to use when it is transfer time.
I do not require any cross-device synchronisation, nor do I need to hope that the photos I’ve just moved remain uncompressed or remain private. Or worry about them being used to train someone’s AI model.
Once my transferred files have been sent, I verify all is well, then delete them from my phone to free up space.
The script is available on my Git repos.
This OP has marked the issue as “solved”.
