linux文件传输到wiond,qr-filetransfer 通过扫描QR码,利用WiFi将文件从计算机传输到移动设备...

qr-filetransfer

625332134c6f4d4600884b99daebf603.png

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

Desktop to mobile

625332134c6f4d4600884b99daebf603.png

Mobile to desktop

625332134c6f4d4600884b99daebf603.png

Install

Go 1.8 is required to run.

go get github.com/claudiodangelis/qr-filetransfer

Installation through a package manager

How does it work?

qr-filetransfer 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.

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.

Usage

625332134c6f4d4600884b99daebf603.png

Note: Both the computer and device must be on the same Wi-Fi network.

On the first run, qr-filetransfer will ask to choose which network interface to use to transfer the files. Choose the network interface connected to your Wi-Fi:

$ qr-filetransfer /tmp/file

Choose the network interface to use (type the number):

[0] enp3s0

[1] wlp0s20u10

Note: On Linux it usually starts with wl.

The chosen network will be saved and no more setup is necessary, unless the -force argument is passed, or the .qr-filetransfer.json file the program stores in the home directory of the current user is deleted.

Two transfers mode are supported: desktop-to-mobile and mobile-to-desktop

Desktop to Mobile

Transfer a single file

qr-filetransfer /path/to/file.txt

Zip the file, then transfer it

qr-filetransfer -zip /path/to/file.txt

Transfer a full directory. Note: the directory is zipped by the program before being transferred

qr-filetransfer /path/to/directory

Mobile to Desktop

If you want to use it the other way, you need to pass the -receive flag.

The first argument is the directory you want to transfer mobile files to.

qr-filetransfer -receive ~/Downloads

Specify the port to use for the web server

qr-filetransfer -port=8080 /path/to/my-file

Note: if the -port argument is passed, the value is stored and used for all future transfers. Use -force to reset the stored port value.

Tips & Tricks

Keep server alive

If you are trying to transfer a file that the browser on the receiving end is considering harmful, you can be asked by the browser if you really want to keep the file or discard it; this condition (browser awaiting your answer) can lead to qr-filetransfer disconnection. To prevent qr-filetransfer from disconnecting, use the -keep-alive flag:

qr-filetransfer -keep-alive /path/to/my/totally/cool.apk

Arguments

-debug increases verbosity

-quiet ignores non critical output

-force ignores saved configuration

-zip zips the content before transferring it

-port sets port to bind the server to

-receive enables transfers from mobile to desktop

-keep-alive keeps the server alive after completing the transfer

Authors

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

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

Clones and Similar Projects

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

License

MIT. See LICENSE.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值