:zap: Transfer files over wifi from your computer to your mobile device by scanning a QR code without leaving the terminal.

Overview

Logo

$ qrcp

Transfer files over Wi-Fi from your computer to a mobile device by scanning a QR code without leaving the terminal.

Go Report Card

You can support development by donating with Buy Me A Coffee.

Join the Telegram channel qrcp_dev for news about the development.

How does it work?

Screenshot

qrcp 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.

The tool prints a QR code that encodes the text:

http://{address}:{port}/{random_path}

Most QR apps can detect URLs in decoded text and act accordingly (i.e. open the decoded URL with the default browser), so when the QR code is scanned the content will begin downloading by the mobile browser.

Send files to mobile:

screenshot

Receive files from mobile:

Screenshot

Tutorials

Installation

Install the latest development version with Go

Note: it requires go 1.8

go get github.com/claudiodangelis/qrcp

Linux

Download the latest Linux .tar.gz archive from the Releases page, extract it, move the binary to the proper directory, then set execution permissions.

# Extract the archive
tar xf qrcp_0.5.0_linux_x86_64.tar.gz
# Copy the binary
sudo mv qrcp /usr/local/bin
# Set execution permissions
sudo chmod +x /usr/local/bin/qrcp

Raspberry Pi

The following ARM releases are available in the Releases page:

  • armv7
  • arm64

Using a package manager

ArchLinux

Packages available on AUR:

Deb packages (Ubuntu, Debian, etc)

Download the latest .deb package from the Releases page, then run dpkg:

sudo dpkg -i qrcp_0.5.0_linux_x86_64.deb
# Confirm it's working:
qrcp version

RPM packages (CentOS, Fedora, etc)

Download the latest .rpm package from the Releases page, then run rpm:

sudo rpm -i qrcp_0.5.0_linux_x86_64.rpm
# Confirm it's working:
qrcp --help

Windows

Download the latest Windows .tar.gz archive from the Releases page and extract the EXE file.

Scoop

If you use Scoop for package management on Windows, you can install qrcp with the following one-liner:

scoop install qrcp

MacOS

Download the latest macOS .tar.gz archive from the Releases page, extract it, move the binary to the proper directory, then set execution permissions.

# Extract the archive
tar xf qrcp_0.5.0_macOS_x86_64.tar.gz
# Copy the binary
sudo mv qrcp /usr/local/bin
# Set execution permissions
sudo chmod +x /usr/local/bin/qrcp
# Confirm it's working:
qrcp --help

Usage

Send files

Send a file

qrcp MyDocument.pdf

Send multiple files at once

When sending multiple files at once, qrcp creates a zip archive of the files or folders you want to transfer, and deletes the zip archive once the transfer is complete.

# Multiple files
qrcp MyDocument.pdf IMG0001.jpg
# A whole folder
qrcp Documents/

Zip a file before transferring it

You can choose to zip a file before transferring it.

qrcp --zip LongVideo.avi

Receive files

When receiving files, qrcp serves an "upload page" through which you can choose files from your mobile.

Receive files to the current directory

qrcp receive

Receive files to a specific directory

# Note: the folder must exist
qrcp receive --output=/tmp/dir

Options

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

qrcp config

Note: if some network interfaces are not showing up, use the --list-all-interfaces flag to suppress the interfaces' filter.

qrcp --list-all-interfaces config 

Configuration File

The default configuration file is stored in $HOME/qrcp.json, however, you can specify the location of the config file by passing the --config flag:

qrcp --config /tmp/qrcp.json MyDocument.pdf

Port

By default qrcp listens on a random port. Pass the --port (or -p) flag to choose a specific one:

qrcp --port 8080 MyDocument.pdf

Network Interface

qrcp will try to automatically find the suitable network interface to use for the transfers. If more than one suitable interface is found, it asks you to choose one.

If you want to use a specific interface, pass the --interface (or -i) flag:

# The webserver will be visible by
# all computers on the tun0's interface network
qrcp -i tun0 MyDocument.dpf

You can also use a special interface name, any, which binds the web server to 0.0.0.0, making the web server visible by everyone on any network, even from an external network.

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.

qrcp -i any MyDocument.pdf

URL

qrcp uses two patterns for the URLs:

  • send: http://{ip address}:{port}/send/{random path}
  • receive: http://{ip address}:{port}/receive/{random path}

A few options are available that override these patterns.

Pass the --path flag to use a specific path for URLs, for example:

# The resulting URL will be
# http://{ip address}:{port}/send/x
qrcp --path=x MyDocument.pdf

Pass the --fqdn (or -d) to use a fully qualified domain name instead of the IP. This is useful in combination with -i any you are using it from a remote location:

# The resulting URL will be
# http://example.com:8080/send/xYz9
qrcp --fqdn example.com -i any -p 8080 MyRemoteDocument.pdf

HTTPS

qrcp supports secure file transfers with HTTPS. To enable secure transfers you need a TLS certificate and the associated key.

You can choose the path to the TLS certificate and keys from the qrcp config wizard, or, if you want, you can pass the --tls-cert and --tls-key:

qrcp --tls-cert /path/to/cert.pem --tls-key /path/to/cert.key MyDocument

A --secure flag is available too, you can use it to override the default value.

Open in browser

If you need a QR to be printed outside your terminal, you can pass the --browser flag. With this flag, qrcp will still print the QR code to the terminal, but it will also open a new window of your default browser to show the QR code.

qrcp --browser MyDocument.pdf

Keep the server alive

It can be useful to keep the server alive after transferring the file, for example, when you want to transfer the same file to multiple devices. You can use the --keep-alive flag for that:

# The server will not shutdown automatically
# after the first transfer
qrcp --keep-alive MyDocument.pdf

Shell completion scripts

qrcp comes with a built-in completion command that generates shell completion scripts.

Bash:

$ source <(qrcp completion bash)

To load completions for each session, execute once:

Linux:

$ qrcp completion bash > /etc/bash_completion.d/qrcp

Note: if you don't want to install completion scripts system-wide, refer to Bash Completion FAQ.

MacOS:

$ qrcp completion bash > /usr/local/etc/bash_completion.d/qrcp

Zsh:

If shell completion is not already enabled in your environment you will need to enable it. You can execute the following once:

$ echo "autoload -U compinit; compinit" >> ~/.zshrc

To load completions for each session, execute once:

$ qrcp completion zsh > "${fpath[1]}/_qrcp"

You will need to start a new shell for this setup to take effect.

Fish:

$ qrcp completion fish | source

To load completions for each session, execute once:

$ qrcp completion fish > ~/.config/fish/completions/qrcp.fish

Authors

qrcp, originally called qr-filetransfer, started from an idea of Claudio d'Angelis (@daw985 on Twitter), the current maintainer, and it's developed by the community.

Join us!

Credits

Logo is provided by @arasatasaygin as part of the openlogos initiative, a collection of free logos for open source projects.

Check out the rules to claim one: rules of openlogos.

Releases are handled with goreleaser.

Clones and Similar Projects

  • qr-fileshare - A similar idea executed in NodeJS with a React interface.
  • instant-file-transfer (Uncredited) - Node.js project similar to this
  • qr-filetransfer - Python clone of this project
  • qr-filetransfer - Another Node.js clone of this project
  • qr-transfer-node - Another Node.js clone of this project
  • QRDELIVER - Node.js project similar to this
  • qrfile - Transfer files by scanning a QR code
  • quick-transfer - Node.js clone of this project
  • share-file-qr - Python re-implementation of this project
  • share-files (Uncredited) - Yet another Node.js clone of this project
  • ezshare - Another Node.js two way file sharing tool supporting folders and multiple files
  • local_file_share - "share local file to other people, OR smartphone download files which is in pc"
  • qrcp - a desktop app clone of qrcp, writing with C# and .NET Core, work for Windows.

License

MIT. See LICENSE.

Comments
  • Improve quit action for better integration

    Improve quit action for better integration

    I'm opening this issue because:

    • [ ] I have found a bug

    • [x] I want to request a feature

    • [ ] I have a question

    • [ ] Other

    • My Go version is: (paste the output of go version and remember that qrcp requires at least version 1.8 of Go)

    • My GOPATH is set to: (paste the output of echo $GOPATH)

    Hi this is a great tool. I am trying to integrate qrcp with xplr. However, ctrl+c to kill the server also kills xplr (not sure why). Is it possible to fix it or map quit to some other key?

    opened by sayanarijit 24
  • QR code doesn't properly render on Windows

    QR code doesn't properly render on Windows

    I'm opening this issue because:

    • [x] I have found a bug
    • [ ] I want to request a feature
    • [ ] I have a question
    • [ ] Other

    the qrcode is too big!!! When I zoom the cmd window, the QR code disappears.

    1

    image

    • My Go version is: (paste the output of go version and remember that qrcp requires at least version 1.8 of Go)
    • My GOPATH is set to: (paste the output of echo $GOPATH)
    opened by jianboy 23
  • feature request: add support for HTTPS

    feature request: add support for HTTPS

    Downloading files over HTTP is never a good idea, even if you're just downloading from your own laptop. Fortunately Go makes super easy having a HTTPS server, feel free to steal the code here and here ^_^

    join the conversation! ready but needs testing 
    opened by evilsocket 18
  • Server still disconnects when transferring APK file on Android phone

    Server still disconnects when transferring APK file on Android phone

    I'm opening this issue because:

    • [ ] I have found a bug

    • [x] I want to request a feature

    • [ ] I have a question

    • [ ] Other

    • My Go version is: go version go1.10.3 darwin/amd64

    • My GOPATH is set to: ~/go

    I'm using the latest version of the tool (I ran go get … last night) and saw that #13 was supposed to be resolved.

    But I continue to experience problems.

    I'm trying to transfer an APK file to an Android device. When I scan the code with, say, Zxing, Google Assistant/Lens, or even Twitter, I get redirected to a browser, which gives me a popup warning that the file is potentially harmful (since it's an application not downloaded from Google Play store). The connection drops at that point. Sometimes a partial download occurs. (I'm guessing the browser application downloads the file in the background, while the user answers the prompt.)

    Is there anything I can do, to help you diagnose this issue?

    opened by efung 16
  • windows installation issue

    windows installation issue

    I'm opening this issue because:

    • [ ] I have found a bug
    • [ ] I want to request a feature
    • [Y] I have a question
    • [ ] Other

    I'm really sorry to submit this issue for asking easy question. But I really have difficult to install QRCP on Windows. I have downloaded Go Lang and use "go get ~/qrcp" cmd. But i can't find Chmod Command on Windows. And there's no ".exe" file in the released package. Can you add a windows version installation guide? Really thanks for that.

    opened by Ipassanti 14
  • Cannot use on Windows when Hyper-V is enabled

    Cannot use on Windows when Hyper-V is enabled

    When Hyper-V is enabled on Windows (for example, when using WSL2), NICs with IP address "192.168.0." are not displayed in the NIC list displayed by qrcp config. It is displayed as 172..., but it is not a valid URL and cannot be used.

    help wanted 
    opened by mikuta0407 13
  • Add Random Sufffix to Link

    Add Random Sufffix to Link

    After reading #2 and the associated ycombinator link, it seemed like the gyfcat form would be a good middle ground, so this pull request adds a random suffix from a small list of animals such as "DogHamsterGerbil" to the end of the url. This list can easily be switched to some sort of config file to lengthen it or not, depending on how much randomness is expected.

    opened by I-Dont-Remember 13
  • server closed when scan the qrcode

    server closed when scan the qrcode

    I'm opening this issue because:

    • [x] I have found a bug
    • [ ] I want to request a feature
    • [ ] I have a question
    • [ ] Other

    Server closed when scan the qrcode by my Android 8.0 phone(before the downloading), I didn't install Go on my macOS 10.14.6, But receiving files from mobile works fine.

    opened by Symous 12
  • Implement as drag-and-drop desktop app

    Implement as drag-and-drop desktop app

    Not all users are tech-savvy enough to use command-line tools, what about bringing the concept of "scan & transfer" to regular desktop apps?

    There might be a couple of usages, for example:

    1. User launches the app, the main window is just a panel through which they can drag and drop the file(s) onto, or click a good old "Select file(s)" button
    2. User drags the file(s) onto the app icon itself (I think many mac apps work this way)

    Afterwards, a QR code is displayed and users can scan & download.

    What do you think? Please share your ideas on this, thank you!

    join the conversation! 
    opened by claudiodangelis 12
  • on macOS 11.0.1, with 0.7.0 from homebrew, transferred data is empty

    on macOS 11.0.1, with 0.7.0 from homebrew, transferred data is empty

    I'm opening this issue because:

    • [x] I have found a bug
    • My Go version is: go version go1.15.6 darwin/amd64
    • My GOPATHis set to: /Users/luke/golang

    I installed qrcp via Homebrew and ended up with 0.7.0 configured with qrcp config and tried a few times to transfer some small files (text, png) to my iPhone, but every time ended up with a blank white page. I then tried opening the URL from a desktop browser and got the same thing... empty white page, with nothing at all in view-source. I am doing this from the LAN directly, no NAT/firewall/port forwarding/DNS involved.

    no errors etc printed to console, not sure how to debug further...

    here is my .qrcp.json

    {
        "fqdn": "macmini.lan",
        "interface": "any",
        "port": 0,
        "keepAlive": true,
        "path": "",
        "secure": false,
        "tls-key": "",
        "tls-cert": ""
    }
    

    thank you

    opened by luckman212 11
  • Generate shell completion scripts

    Generate shell completion scripts

    cobra, the library used to implement qrcp's command line, supports the generation of shell completion scripts for bash and zsh (and more?).

    We should add the ability to generate such scripts for qrcp: https://github.com/spf13/cobra/blob/master/bash_completions.md

    These scripts should also be included in the deb and rpm packages, as well as in the .tar.gz packages.

    ready but needs testing 
    opened by claudiodangelis 11
  • Wake lock within file-upload webpage - Android

    Wake lock within file-upload webpage - Android

    I'm opening this issue because:

    • [enhancement ] Mobile - Android
    • request wake lock within the file upload webpage, this will make the screen while the webpage is on.
    • this could in avoiding any interruptions in upload if any.
    opened by gkathir15 0
  • [enhancement] Right-click context menu shortcuts for qrcp (Windows)

    [enhancement] Right-click context menu shortcuts for qrcp (Windows)

    I realized that this tool would be much more useful with the added feature of using right-click context menu on selected items/directories to send/receive files.

    So I created some helper scripts to add & remove the necessary shortcuts and registry keys & values on Windows machines:

    Attached: qrcp_context_menu_helper.zip

    I hope it helps!


    Installation:

    Run ADD.bat to install, REMOVE.bat to uninstall the key/values and shortcuts. That's it.

    Usage:

    Send:

    Single:

    To send a single file, right-click on the selected file, and select qrcp send. send_single

    Multiple:

    To send single or multiple files (zipped), right-click on the selected file(s), Share, and select qrcp Send Multiple. send_multiple

    Receive:

    To receive files to the selected directory, right-click in an empty spot of the folder, and select qrcp receive. receive_multiple

    Note: If config.json has the output field set, it will receive files to that specified path regardless. So make sure to clear it to use this functionality.


    The primary problem for me here is that I am unsure how to PR this feature to this repository, as it is 100% Go and non-Windows specific.

    In addition, if the .exe file could get an icon, it would be straightforward to add icons to these shortcuts as well.

    opened by egemenertugrul 1
  • sharing within the local network

    sharing within the local network

    I'm opening this issue because:

    • [ ] I have found a bug
    • [x] I want to request a feature
    • [ ] I have a question
    • [ ] Other

    I was wondering if it was possible to expand the sharing of files not only to the local network but also to the outside perhaps using ngrok to create a URL to be used outside without opening ports

    opened by AlessioDevv 0
  • Use spf13/viper for managing the configuration file

    Use spf13/viper for managing the configuration file

    This PR adds viper configuration management. Major changes:

    • configuration file will now use YAML rather than JSON
    • configuration parameters will be also read from the environment variable using the QRCP_ prefix

    I'm still unsure whether or not we should add a function to automatically migrate the old JSON configuration file to YAML.

    What is still missing:

    • [x] README update
    • [x] Proper testing of environment variables
    • [x] Add migrate function to transparently migrate to the new YAML configuration file
    opened by claudiodangelis 3
  • Error with many arguments in util/util.go

    Error with many arguments in util/util.go

    When I try to compile the package I get the following message

    " src/github.com/claudiodangelis/qrcp/util/util.go:65:38: too many arguments in call to zip.Add have(string, *os.File, fs.FileInfo) want(string, []byte) " I would like to know why several arguments are passed and if this could not be changed on line 65 of the util/util.go file?

    Thank you and congratulations for the work

    • [ ] I have a question
    • My Go version is: 1.19
    opened by gpxlnx 1
Releases(0.9.1)
Fabric-Batch-Chaincode (FBC) is a library that enables batch transactions in chaincode without additional trusted systems.

Fabric-Batch-Chaincode Fabric-Batch-Chaincode (FBC) is a library that enables batch transactions in chaincode without additional trusted systems. Over

Datachain 1 Nov 9, 2022
🧑‍💻 Go XML generator without Structs™

exml ??‍?? Go XML generator without Structs™ Package exml allows XML documents to be generated without the usage of structs or maps. It is not intende

Victor 3 Nov 15, 2022
Schedule daily tweets from markdown files in your repo, posted via github actions.

markdown-tweet-scheduler Schedule daily tweets from markdown files in your repo, posted to twitter via github actions. Setup Fork this repo Get your t

reid j sherman 87 Oct 26, 2022
Convert your markdown files to PDF instantly

Will take a markdown file as input and then create a PDF file with the markdown formatting.

Arnab Sen 27 Nov 7, 2022
A markdown renderer package for the terminal

go-term-markdown go-term-markdown is a go package implementing a Markdown renderer for the terminal. Note: Markdown being originally designed to rende

Michael Muré 252 Nov 23, 2022
:sushi: emoji terminal output for golang

Emoji Emoji is a simple golang package. Get it: go get github.com/kyokomi/emoji/v2 Import it: import ( "github.com/kyokomi/emoji/v2" ) Usage packag

kyokomi 724 Nov 14, 2022
Glow is a terminal based markdown reader designed from the ground up to bring out the beauty—and power—of the CLI.💅🏻

Glow Render markdown on the CLI, with pizzazz! What is it? Glow is a terminal based markdown reader designed from the ground up to bring out the beaut

Charm 10.6k Nov 28, 2022
a simple and lightweight terminal text editor written in Go

Simple Text editor written in Golang build go build main.go

buzz 3 Oct 4, 2021
Note - A text editor for the Linux Terminal! (Mainly compatible with Arch, because I made it on there)

Note - A text editor for the Linux Terminal! (Mainly compatible with Arch, because I made it on there)

Awesome Sauce 5 Jul 15, 2022
A terminal based preview tool for markdown 🍪

Smooth Smooth is a terminal based preview tool for markdown. Features Turning: turn next/previous slide Scroll: scroll up/down slide Search: search wo

ketsu chin 3 May 22, 2022
Go library to parse and render Remarkable lines files

go-remarkable2pdf Go library to parse and render Remarkable lines files as PDF.

Jay Goel 35 Nov 7, 2022
🚩 TOC, zero configuration table of content generator for Markdown files, create table of contents from any Markdown file with ease.

toc toc TOC, table of content generator for Markdown files Table of Contents Table of Contents Usage Installation Packages Arch Linux Homebrew Docker

Yagiz Degirmenci 87 Jul 27, 2022
Fast and secure steganography CLI for hiding text/files in images.

indie CLI This complete README is hidden in the target.png file below without the original readme.png this could have also been a lie as none could ev

BoB 4 Mar 20, 2022
network .md into .html with plaintext files

plain network markdown files into html with plaintext files plain is a static-site generator operating on plaintext files containing a small set of co

Alexander Cobleigh 70 Nov 13, 2022
Parse data and test fixtures from markdown files, and patch them programmatically, too.

go-testmark Do you need test fixtures and example data for your project, in a language agnostic way? Do you want it to be easy to combine with documen

Eric Myhre 20 Oct 31, 2022
Generate a global index for multiple markdown files recursively

markdown index Markdown-index is a library to help you generate a global index for multiple markdown files recursively in a directory, containing a su

Mateus Miranda 18 Sep 25, 2022
Quick and simple parser for PFSense XML configuration files, good for auditing firewall rules

pfcfg-parser version 0.0.1 : 13 January 2022 A quick and simple parser for PFSense XML configuration files to generate a plain text file of the main c

Rory Campbell-Lange 0 Jan 13, 2022
Sqly - An easy-to-use extension for sqlx, base on xml files and named query/exec

sqly An easy-to-use extension for sqlx ,base on xml files and named query/exec t

nvac 1 Jun 12, 2022
:evergreen_tree: Parses indented code and returns a tree structure.

codetree Parses indented code (Python, Pug, Stylus, Pixy, codetree, etc.) and returns a tree structure. Installation go get github.com/aerogo/codetree

Aero 22 Sep 27, 2022