Skip to content

Recently I was watching a video about a guy who start uploading files to youtube, so I thought it would be cool to have a script to upload files to dontpad. Why not?

Notifications You must be signed in to change notification settings

publi0/dontpad-storage

Repository files navigation

DontPad File Uploader

Recently I was watching a video about a guy who start uploading files to youtube, so I thought it would be cool to have a script to upload files to dontpad. Why not?

Go

table of contents

Description

This API will upload a file to dontpad.com, you can use it to upload images, videos, pdfs, etc. All files will be encrypted and checksumed before being uploaded and download.

Architecture / Pipeline

image

Getting Started

Start by running the go server:

go run cmd/main.go

Then you can upload a file using curl:

curl -X PUT -F "file=@/Users/publio/Downloads/IMG_20190818_123456.jpg" http://localhost:8080/files

Endpoints:

  • PUT /files
    • Description: Upload a file
    • Body: multipart/form-data
    • Params: file
  • GET /files
    • Description: List all files
    • Response: json
    • Params: none
  • GET /files/{id}
    • Description: Get a file
    • Response: file
    • Params: file id
  • DELETE /files/{id}
    • Description: Delete a file
    • Response: json
    • Params: file id

Obs: Inside the /requests folder you can find a insomnia collection with all requests.

Tech stack

  • Go
  • Sqlite

Config

  • You can change the encryption key in the config file (/resources/key.txt)

About

Recently I was watching a video about a guy who start uploading files to youtube, so I thought it would be cool to have a script to upload files to dontpad. Why not?

Resources

Stars

Watchers

Forks