file_transfer is a very simple file transfer service. The principle is to upload the file to a temporary file server, and then you can get the file with address of the HTTP protocol. You or your partner can use wget or browser to download the file.
file_transfer.yml
# bind address
listen_address: ":8080"
# the directory where the file is saved
upload_dir: "/tmp"
# URL prefix of the generated download address
url_prefix: "http://localhost:8080/download"
basic_auth:
# enable basic_auth
enabled: false
username: "vearne"
password: "happyft"
make build
make install
default install directory
/usr/local/bin/
You can also find the compiled files in release releases
file_transfer -c /tmp/file_transfer.yaml
If no configuration file is specified, the search order of the configuration file is
- Current work directory
- /etc/
- /etc/file_transfer
ps -ef| grep file_tran|head -n 1 |awk '{print $2}'|xargs kill
disenable basic auth
curl -F file=@tt.png http://localhost:8080/upload
wget http://localhost:8080/download/tt.png
enable basic auth
curl -F file=@tt.png http://localhost:8080/upload --user vearne:happyft
wget --http-user=vearne --http-password=happyft http://localhost:8080/download/tt.png
You can also download the file by visiting the following URL directly in your browser.
http://localhost:8080/download
Basic auth is less secure and if it is used in a production environment,you may put your files in potential security hazard.