Giter Club home page Giter Club logo

file_transfer's Introduction

file_transfer


中文README

Overview

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.

Configuration 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"

Usage

Build

make build

install

make install

default install directory

/usr/local/bin/

You can also find the compiled files in release releases

Start

file_transfer -c /tmp/file_transfer.yaml

If no configuration file is specified, the search order of the configuration file is

  1. Current work directory
  2. /etc/
  3. /etc/file_transfer

Stop

ps -ef| grep file_tran|head -n 1 |awk '{print $2}'|xargs kill

Upload/Download Example

disenable basic auth

curl -F [email protected] http://localhost:8080/upload
wget http://localhost:8080/download/tt.png

enable basic auth

curl -F [email protected] 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

Warning

Basic auth is less secure and if it is used in a production environment,you may put your files in potential security hazard.

file_transfer's People

Contributors

vearne avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.