Skip to content

Instantly share code, notes, and snippets.

@sh4dowb sh4dowb/goupload

forked from rewida17/goupload
Created Jun 18, 2020
Embed
What would you like to do?
Upload files to gofile.io via api. Required curl and jq
#!/bin/bash
#Simple test/help
if [[ "$#" == '0' ]]
then
echo -e '\nPlease Select File\n'
#Great, file selected.. Lets upload that..
elif [[ "$#" == '1' ]]
then
#Find Best server to upload
srv=$(curl -s https://apiv2.gofile.io/getServer | 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".gofile.io/upload | jq -r '.data|.code')
echo -e "\nYour Link: \nhttps://gofile.io/?c=$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.