📅 July 09, 2020     🕐 4 minutes read

Transfer Files Over Wi-Fi Between a Computer and a Mobile Device by Scanning a QR Code

A foss, cross-platform program to send files between your computer and mobile devices

 

If you’re looking for a cross platform command line program that allows you to send files between your computer and your mobile devices ( and vice-versa ) you should take a look at qrcp. 

It binds a web server to the address of your Wi-Fi network interface on a random port and creates a handler for it. The default handler serves the content and exits the program when the transfer is complete. When used to receive files, qrcp serves an upload page and handles the transfer.

NOTE: Before installing and using it, you should know that qrcp does not have support for HTTPS (yet), which can be an issue. Also, you might have to add/edit firewall rules in order for qrcp to work.

 

INSTALLATION:

Option 1. ( all platforms ) Install the latest development version of qrcp with Go ( requires go 1.8 or later): go get github.com/claudiodangelis/qrcp

Option 2. ( all platform ) Download the binary and:

1. Generic Linux/macOS:

  • Extract the archive with: tar xf qrcp_0.6.3_linux_x86_64.tar.gz / qrcp_0.6.3_macOS_x86_64.tar.gz ( NOTE: replace the name of the archive with the one you download )
  • Move the binary to its proper location with: sudo mv qrcp /usr/local/bin
  • Make the binary executable with: sudo chmod +x /usr/local/bin/qrcp

macOS users can also install qrcp via Homebrew with brew install qrcp

 

Debian/Ubuntu and derivates:

  • Download the .deb package from the link above and install with sudo dpkg -i qrcp_0.6.3_linux_x86_64.deb ( NOTE: replace the name of the .deb package with the one you download )
  • Confirm it’s working with qrcp version

 

Fedorda/openSUSE/CentOS/etc:

  • Download the .rpm package from the link above and install with sudo rpm -i qrcp_0.6.3_linux_x86_64.rpm ( NOTE: replace the name of the .rpm package with the one you download )
  • Confirm it’s working with qrcp --help

 

Windows

  • Download the Windows .tar.gz archive from the link above and extract the .exe file.

 

Option 3. If you’re using Arch Linux or a distro based on Arch, qrcp is available in the AUR: qrcp and qrcp-bin

 

You can also compile qrcp from source. Since I don’t have a Windows machine, and there’s no point in using this on my Mac, I’m going to install it on my Arch based machine with yay -S qrcp

 

CONFIGURATION

qrcp works without any prior configuration, however, you can choose to configure to use specific values. Run qrcp config to launch a wizard that lets you configure parameters like interface, port, fully-qualified domain name and keep alive.

If you don’t run the config wizzard and you have multiple network interfaces, when you’ll first run qrcp it will ask you to choose the interface you want to use.

You can also chose any (0.0.0.0) as the network interface to make the file(s) available to everybody on the same network as well as external networks. This is useful when you want to transfer files from your Amazon EC2, Digital Ocean Droplet, Google Cloud Platform Compute Instance or any other VPS.

By default qrcp listens on a random port. If you want to choose a specific port you can pass the --port or -p flag. Example: qrcp -p 8080 path/to/file.

The default configuration file is stored in $HOME/qrcp.json.

 

USAGE

Running qrcp help will give you a general idea of how to use the program to send and receive files between device.

 

To send a file from your computer to your phone or tablet use qrcp /path/to/file. You can also send multiple files and/or folders this way.

 

Now just take your phone or tablet and use your preferred method to scan the QR code generated by qrcp.

 

To receive a file use qrcp receive. Scan the QR code and send files from your phone or tablet to your computer. If you want to receive the files to a specific folder you can use qrcp receive --output=/path/to/folder/

 

Fore more info, config and troubleshooting check out the official repo on Github

SUPPORT

Coffee   If you this, consider buying me a coffee!
Bitcoin (BTC) 1Hfuq77gKKFJeNcq4EP4dQK3yDRWrFEwJR
Bitcoin Cash (BCH) qzmdm6e6q5wf2p6sxz2mst7cenz60newwc5m4e9js8
Ether (ETH) 0x5f02869278C24A6579d3820f52AD15936D6F9d69
Stellar (XLM) GDWT2QU2CI3GZ5XH5DTSU3IUAHZMTB6VQKKRHBYWS5YCCQOAG6OKG2OB
More content?