Zack Scholl

zack.scholl@gmail.com

Share

 / #websites #portfolio 

A website for sharing files.

TLDR: Check out the website at share.schollz.com.

share is an open-source server where you can easily share files through the browser or the terminal. share is inspired by transfer.sh and send.firefox.com which also store files temporarily after uploading via the browser or command-line.

One main new feature in share specifically is that the files are stored for time based on the file size, so that smaller files will stay available longer (by default, the time to deletion is scaled so that 1 GB file will be deleted after 30 minutes). Another nice improvement is that each uploaded file gets a permalink based on the hash of file content, so you can easily share a unique content-addressable six-digit identifier instead of a long filename.

Usage

Open the browser share.schollz.com and upload a file.

Alternatively you can upload via the command-line:

Upload a file

$ curl -L --progress --upload-file README.md share.schollz.com
https://share.schollz.com/bemi4x/README.md

Use this .bashrc/.zshrc shortcut:

1alias share='f() { curl --progress-bar --upload-file "$1" https://share.schollz.com | tee /dev/null; echo };f'

Download a file

You can download the file with just the unique ID, or with the filename added. So each of these are identical:

$ curl -L share.schollz.com/bemi4x
$ curl -L share.schollz.com/bemi4x/README.md

or you can use wget:

$ wget --content-disposition share.schollz.com/bemi4x

Install

You can easily install and run share on your own computer or server. First, make sure to install Go. Then clone the repo and generate the code and run.

1$ git clone https://github.com/schollz/share.git
2$ cd share/
3$ go generate
4$ go build -v
5$ ./share

Use the flags (see share --help) for setting the max directory size, max file size, port, etc.

Docker

You can also easily install and run with Docker (an 8MB image!).

$ docker run -d -v `pwd`/data:/data -p 8222:8222 schollz/share

If you are running on a public server, be sure to include -e url=https://YOURURL.com when running with Docker so that it presents the right URL in HTTP responses.

Acknowledgements

This is inspired by other great file transfer utilities and also utilizes Dropzone.js and uses logos from Logodust.