Skip to content

Instantly share code, notes, and snippets.

@sh4dowb sh4dowb/goupload

forked from rewida17/goupload
Created Jun 18, 2020
What would you like to do?
Upload files to via api. Required curl and jq
#Simple test/help
if [[ "$#" == '0' ]]
echo -e '\nPlease Select File\n'
#Great, file selected.. Lets upload that..
elif [[ "$#" == '1' ]]
#Find Best server to upload
srv=$(curl -s | jq -r '.data|.server')
#Litlebit of hacking ;) (after upload, api respond with JSON that contain response code and file id)
upload=$(curl -X POST -# -F email=<MAIL_ADDRESS> -F description="${1%.*}" -F filesUploaded=@"$1" https://"$srv" | jq -r '.data|.code')
echo -e "\nYour Link: \n$upload\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.