# go-share #

go-share is a small and simple file sharing server written in go. Files are uploaded, downloaded and deleted with http PUT, GET and DELETE respectively.

When uploading file to eg. https://share.nekineki.net/file.txt the returned url is in format https://share.nekineki.net/SHA256SUM/file.txt, where SHA256SUM in sha256 checksum of the file.

## use with curl ##

### upload ###

$ curl --upload-file file.txt https://share.nekineki.net
https://share.nekineki.net/57fa37e55dc8312737ef5b070d2388adae464e187878f6e84158b72a9efd98c9/file.txt

### download ###

$ curl https://share.nekineki.net/57fa37e55dc8312737ef5b070d2388adae464e187878f6e84158b72a9efd98c9/file.txt
this is the file content

### delete ###

$ curl -X DELETE https://share.nekineki.net/57fa37e55dc8312737ef5b070d2388adae464e187878f6e84158b72a9efd98c9/file.txt
file deleted; 200 OK

## use with javascript ##

Using curl is obviously better but if you only have a web browser here is some javascript to do the same thing (it makes the same PUT and DELETE http requests).

Links to uploaded files are stored in localStorage, so they are preserved even if you refresh the page.

### upload ###

status: ready

### delete ###

status: ready

url: