qrcp: Transfer Files Between Desktop And Mobile Devices Over Wi-Fi By Scanning A QR Code


qrcp is a command line tool to transfer files from a desktop to a mobile device (and the other way around) over Wi-Fi, by scanning a QR code. It's available for Microsoft Windows, macOS and Linux.

The application binds a web server to the address of your Wi-Fi network interface on a random port (though the port can be specified if you want). When the QR code is scanned, the download begins (or you can open the URL scanned by the QR app in a web browser and the download will begin then). Once the transfer is completed, the web server is automatically stopped.

For transferring files from a mobile device to a desktop, qrcp serves a web page that can be used to choose the files you want to transfer.

Both when transferring files from a desktop to a mobile device and the other way around, a URL is shown in the terminal so you can type that instead of scanning the QR code if you wish.

So what about sending multiple files at once or even folders? qrcp supports that too - in such cases, it automatically creates a zip archive of the files or folders you want to transfer, and deletes the zip archive once the transfer is completed.

To send a file to a mobile device from your desktop over Wi-Fi, run qrcp with the file as its argument, like this (example):

qrcp Image.jpg

Do the same to send a folder, e.g. qrcp /path/to/folder.

To send multiple files, use (example):

qrcp Image1.jpg Image2.jpg Image3.jpg

To receive file from the mobile device to your desktop over Wi-Fi, in the current directory, use:

qrcp receive

Or, to receive the files in a specific directory:

qrcp receive --output=/path/to/directory

When you run the receive command, scanning the QR code on your mobile device opens a web page that lets you pick files from your mobile device to transfer them to your desktop on which you ran qrcp.

qrcp choose network interface

It's worth noting that in case you have multiple network interfaces, the first time you run qrcp it will ask you to choose the network interface to use for the file transfer (the one you need to choose is usually in this form: enp3s0 or eth0).

You may also choose any ( as the network interface, in which case the file becomes available not only to everyone on the same network, but also from external networks (as long as the port is not blocked by your firewall or router).

The application configuration is stored in a hidden .qrcp.json file in the user home directory.

These are the available qrcp options:

$ qrcp --help
  qrcp [flags]
  qrcp [command]

Available Commands:
  config      Configure qrcp
  help        Help about any command
  receive     Receive one or more files
  send        Send a file(s) or directories from this host
  version     Print version number and build information.

  -c, --config string         path to the config file, defaults to $HOME/.qrcp
  -d, --fqdn string           fully-qualified domain name to use for the resulting URLs
  -h, --help                  help for qrcp
  -i, --interface string      network interface to use for the server
  -k, --keep-alive            keep server alive after transferring
  -l, --list-all-interfaces   list all available interfaces when choosing the one to use
      --path string           path to use. Defaults to a random string
  -p, --port int              port to use for the server
  -q, --quiet                 only print errors
  -z, --zip                   zip content before transferring

Use "qrcp [command] --help" for more information about a command.

Download qrcp

qrcp is available for Microsoft Windows, macOS and Linux.

On Linux, it's packaged as a DEB (for Debian, Ubuntu and other Linux distributions based on these, like Linux Mint, Pop!_OS, Zorin OS, Elementary OS, and so on), RPM (for Fedora, openSUSE, CentOS etc.). There's also a generic Linux binary that should work on any Linux distribution. It's also available on AUR for Arch Linux and Manjaro users.

h/t: atareao.es