Skip to content

Instantly share code, notes, and snippets.

@N-F9
Created February 19, 2022 19:30
Show Gist options
  • Save N-F9/db16d02027654609ab3783a3e1dde534 to your computer and use it in GitHub Desktop.
Save N-F9/db16d02027654609ab3783a3e1dde534 to your computer and use it in GitHub Desktop.
A super small script to upload a file to anonfiles API.
#!/usr/bin/env bash
content=$(curl -s -F "file=@$1" https://api.anonfiles.com/upload)
url=$(jq -r '.data.file.url.short' <<< "$content")
name=$(jq -r '.data.file.metadata.name' <<< "$content")
size=$(jq -r '.data.file.metadata.size.readable' <<< "$content")
echo -e ""
echo -e "\e[0;30m┌─\e[0m ${name} \e[0;30m─\e[0m ${size}"
echo -e "\e[0;30m└\e[0m \e[1;97m${url}\e[0m"
echo -e "\e[0m"
@N-F9
Copy link
Author

N-F9 commented Feb 19, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment