
Ask HN: How to easily transfer files between devices - billconan
I own one linux and one mac computer, and also one iphone. I found transferring files between them is not convenient.<p>Airdrop is nice, but is not available for the linux machine. I have been using scp between the mac and the linux.<p>And if I need to transfer something to my phone, I will have to scp to my mac first, then airdrop.<p>webrtc based anonymous services like<p>https:&#x2F;&#x2F;file.pizza&#x2F;<p>https:&#x2F;&#x2F;www.sharedrop.io&#x2F;<p>are not ideal either. mainly they expect people to type very long urls or share urls with a message app. But in many cases, I need to share files with random people, I don&#x27;t know how to exchange the long urls.<p>I want to make something better to solve this problem (as a side project). I have been having the itch for doing it for long. But every time I consult my friends about this idea, they don&#x27;t seem to feel the pain that much.<p>Is this worth my time solving? Or I just missed some already existed solutions?
======
jjjbokma
Instead of `scp` you can use `rsync`. iOS13 supports SMB via the file manager,
you can set up SMB on the Linux machine and access your files on both the Mac
and the iPhone via SMB.

~~~
revicon
I think I'm not understanding how you would access files on an iphone via SMB.

~~~
leokennis
In the Files app, click on the “...” button in the top right. Then choose
“Connect to Server”.

------
appleiigs
Between Mac and Linux, I use "python -m http.server". Specifically, I go to
the source folder, run the python simple HTTP server. Then in the destination
computer or iPhone, I browse the source folder.

If you want to get extra fancy, you can use an alias in .bashrc to shorten the
"python -m http.server" to something you prefer.

I use the Mac apps to transfer from iphone to Mac.

------
SiDevesh
I use kdeconnect extensively and it's by far the best solution I have seen.
Not only does it allow for sending files but you can even browse the storage
on your phone from your computer wirelessly, plus it does notifications
syncing, remote commands and a whole lot more. It's actually available now for
linux as well as mac and windows and runs great.

~~~
dTal
+1 for KDE Connect. Really feels like living in the future (that is, the
future that should have arrived 10 years ago).

The really cool thing is it's peer-to-peer - if you have multiple desktops
running KDE Connect, they can all send files to each other!

Not great for sharing files with "random people" though.

------
kstenerud
I'm working on this problem now. I'm still building the lower layers, which
are:

\- An RPC mechanism (not built yet)

\- A bi-directional multiplexing stream protocol [1] (mostly there)

\- A general purpose binary encoding mechanism [2] (I've gotten bogged down
with this for the past few months, but I can finally see the light at the end
of the tunnel!)

The idea is to get these lower layers finished so that I can build all of my
data communications related projects on top of them. One of those is a
general-purpose file access system that I can build actual products on top of,
such as file managers, remote filesystems, streaming services,
synchronization, etc. I'm rebuilding everything underneath because the
existing protocols are too chatty and bloated, not modular enough, don't work
with encryption, or have weird requirements (like NFS requiring kernel
integration for example, or they're restricted to the local net, etc).

[1]
[https://github.com/kstenerud/streamux/blob/master/streamux-s...](https://github.com/kstenerud/streamux/blob/master/streamux-
specification.md)

[2] [https://github.com/kstenerud/concise-
encoding](https://github.com/kstenerud/concise-encoding)

~~~
aisofteng
Impressive effort. I’m sure you looked at it, so I’m curious why not use gRPC?
To avoid HTTP?

~~~
kstenerud
I've looked at all of the protocols out there, and the short reason list is
one or more of:

* they're too chatty.

* They waste too much on overhead.

* their bidirectional support is poor.

* Their asynchronous support is poor.

* They can't multiplex across multiple connections.

------
pure_simplicity
You could try onionshare [[https://onionshare.org/](https://onionshare.org/)]
Or you could try magic wormhole [[https://github.com/warner/magic-
wormhole](https://github.com/warner/magic-wormhole)]

------
andor
All of the cloud drives solve this issue.

If you just want something simple for personal use, I'd look into the iOS
Shortcuts app. Shortcuts can send files that were shared to it via HTTP or SSH
(as STDIN to a shell command), and it can store files on your phone. You could
use QR codes to exchange URIs, IP addresses or file paths.

For example, to send from Linux to iOS:

    
    
      - Linux machine serves file over HTTP, displays a QR code with the URL
      - You scan QR code and download the file
    

For iOS -> Linux:

    
    
      - Linux machine displays QR code with its IP address
      - On your phone, you share the file with a shortcut
      - The shortcut scans the QR code, then connects to the machine via SSH.
      It runs an application on your Linux machine (e.g. cat > /tmp/file-from-ios)
      and passes the file in as input.

~~~
afarrell
Why can’t there just be one simple solution for this which is peer-to-peer?
Why does it have to depend on the cloud?

Because in order to be simple, any solution requires the skilled time and
attention of an engineer to create an abstraction layer over the fiddly
details. And to update that as the device takes updates.

If you do it as a peer-to-peer tool, that effort is O(N^2). Adding Each new
platform requires ensuring that it works with N other platforms you already
support.

If you introduce some intermediary like a cloud server, then the problem is
O(N). When you add a new platform, just make sure it works to talk between the
server and that 1 type of client.

But why does the intermediary have to be a whole server? Why can’t it be a
protocol or format? <% insert explanation from someone more knowledgeable
about filesystems %>

~~~
andor
_Why can’t there just be one simple solution for this which is peer-to-peer?
Why does it have to depend on the cloud?_

Peer to peer solutions are more difficult to build because there are more
problems to solve:

* Peers need to be in the same network (same Wifi, Internet, etc.). If they are not, a connection needs to be established in some way.

* Peers need to know how to reach each other. How can they exchange addresses?

* Network/OS needs to allow exchanging messages (NAT, firewalls, proxies, ...). If they can't, then what?

All of these are complicated and have lots of error cases.

Cloud-based solutions make some assumptions to simplify the problem space:
peers have a working internet connection, they can use DNS to look up
addresses, and can reach a centralized server, usually via HTTP. It's even
better if they are browser based, then peers don't need to install a new
client.

As Bluetooth and Airdrop show, things don't always need to be cloud based. But
also, as Bluetooth shows, it's really difficult to make it work seamless.

------
pbalau
I'm using the "stupid" method of emailing stuff to myself. Works for pictures
I'm taking with my phone and I also don't have to spend too many neurons doing
so.

------
mcphage
Here's how I'd love this process to work:

Let's assume that the service is called "Throwbox", and you have an account
with username `you@foo.com`, and the person you want to send a file to has
username `them@bar.com`:

\- You have a folder on your computer called "Throwbox"

\- Inside that folder you create a folder called "them@bar.com" (so
/Throwbox/them@bar.com)

\- You put a file inside that folder.

\- They create a folder inside their Throwbox directory called "you@foo.com"
(so /Throwbox/you@foo.com)

\- The file that you put in the folder on your machine gets copied onto the
folder they created on their machine.

That way you don't need any information from them other than their username,
and you can't send files to people who don't want to receive them. If you
don't want to get files from another person anymore, then just delete the
directory with their email address. And sending files is 2 way; if you want to
send them a file back, just put it in the same place.

~~~
mclehman
This is pretty much* how the Keybase filesystem works, with the added benefit
of using more identities than just emails/usernames. Even if you only know
someone's Twitter handle or reddit account, you can have this same workflow.

*Except for the "unless they don't want to receive files from you" part.

------
Matthias247
Existing solutions that cover this are services like Onedrive, Dropbox & Co.
Copy things into one folder one a device and it will show up on all other
devices. Either directly downloaded, or easily be available for download.

with a couple of clicks you can also share the things via URL with someone
else.

~~~
revicon
Agreed. Unless you're moving around huge files, dropbox does this very well.
Run the client on your linux and mac boxes and install the app on your iphone.
Files are backed up to the cloud and available on all devices. All my txt
notes, photos, and other files I care about are on dropbox and available on
any device I want them to be.

And it's easy to share out individual files or folders from dropbox so others
can access them.

------
auslegung
The usability difference between a platform-agnostic AirDrop, and Dropbox,
just isn’t big enough imo. Most people are happy enough with Dropbox or Drive.

I mean, I wish something like this existed, but I just don’t think there’s
enough real need

------
weikju
AirDrop is supposedly based on the OWL protocol, and is possible to use under
Linux. Never tested it myself..

[https://owlink.org/](https://owlink.org/)

------
emj
It's worth it! Even tough it's been worked upon forever; Dropbox. Napster,
Emule, FTP, Kazaa, MIME, zmodem. I've never connected the dots between these
two comics but they are published just some months a part. Basically this is a
social problem not a technical one.

[https://xkcd.com/949/](https://xkcd.com/949/)
[https://xkcd.com/927/](https://xkcd.com/927/)

------
wtmt
For sharing files between your own devices, AirDroid [1] would be the simplest
one to use. It’s also accessible on web.airdroid.com so you can drop files on
to the website and send to or receive from other devices.

For sharing with random people, if you can’t send long URLs (through messages
or even through a QR code), then you probably can’t ask them to install an app
or visit a website I suppose.

[1]: [https://airdroid.com](https://airdroid.com)

------
DerekRobot
Could you make something like the old Windows Personal Server [1], but dummy-
proof? Make the app a DYNDNS client and let them register subdomains on your
short domain (mybox.foo.bar/file.png). Essentially just a very simple server
like XAMPP that users can drop their files into.

[1]
[http://www.windowsnetworking.com/j_helmig/w98pws.htm](http://www.windowsnetworking.com/j_helmig/w98pws.htm)

------
A1CY0N
Have a look at [https://syncthing.net/](https://syncthing.net/)

It's open source and your data will be encrypted.

------
rambojazz
The core problem here is not what program to use for transferring files, but
rather how one device can reach the other. With all the firewalls, proxies,
NATs, and whatnot, it's quite difficult to establish a direct connection
between two devices without using an intermediary server. If you can make the
connection simple, such as in your LAN, files exchange becomes trivial.

------
leokennis
Personally I use my Fastmail storage, which you can access via WebDAV.

I don’t know about Linux but I’m assuming it handles WebDAV as well.

In Finder and Windows Explorer you can natively add a WebDAV location and it
shows as a (removable) drive.

On iOS you can connect to WebDAV natively from the Files app, or use third
party apps like FileExplorer.

Very convenient for “normal files”, maybe not that good for very large files.

------
sellingwebsite
I use Firefox Send for that
[https://send.firefox.com](https://send.firefox.com)

~~~
terrycody
I use this too.

------
sigsergv
Resilio sync works like dropbox and exists for all platforms.

Sometimes I use [woof]([http://www.home.unix-
ag.org/simon/woof.html](http://www.home.unix-ag.org/simon/woof.html)) that
starts simple web server and prints link to the file you can use to download
it.

------
ajennings
I tried this as a side project:
[http://sendfiles.direct/](http://sendfiles.direct/)

It's not perfect, but I still use it sometimes.

------
Daedren
Pushbullet is still a good alternative that works everywhere. Plus it allows
for sharing text and links as well.

Snapdrop is a nice option as well, plus you can save it as a PWA

------
quickthrower2
I use OneDrive across windows and iOS. Not sure what the Mac story would be
with that. For bigger files it’s the sneakernet (USB drive)!

------
yjftsjthsd-h
> And if I need to transfer something to my phone, I will have to scp to my
> mac first, then airdrop.

Aren't there scp/rsync clients for iPhone?

------
bitfhacker
I use an app named "Handshaker" between Android and Mac. Its works pretty
well.

------
throw7
I use syncthing, but I don't think there is an ios client.

------
simon_acca
‘python3 -m http.server’ is useful in many occasions

------
tjasper2000
usb drive

~~~
devnonymous
This migth've been tongue-in-cheek but seriously, this is what I do a lot of
the time. I have a usb drive specifically to quickly move files around with a
dual USB type A and micro-usb interface, specifically to move files from my
phone. Less thinking / worrying/ debugging "why-didn't-that-work".

