Skip to content

Instantly share code, notes, and snippets.

@pseudoClone
Created September 19, 2023 03:37
Show Gist options
  • Save pseudoClone/2635df24f940376eb36f43ef679ecf2d to your computer and use it in GitHub Desktop.
Save pseudoClone/2635df24f940376eb36f43ef679ecf2d to your computer and use it in GitHub Desktop.
Simple file upload
#!/bin/bash
set -xe
url='0x0.st'
fname=$1
tempax='tempa'
touch $tempax && cat $fname > $tempax
ext=$(cut -d '.' -f2 <<< $fname)
rm -rf $tempax
if [[ "$ext" == "pdf" ]]; then
exit 1
else
curl -F "file=@$fname" $url
echo -e '\n'
fi
@pseudoClone
Copy link
Author

new: dont have to write curl command everytime

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