mirror of
https://github.com/dutchcoders/transfer.sh.git
synced 2026-02-03 06:03:25 +00:00
Multiple Files? #380
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @h1rule on GitHub.
Hello,
im trying to upload multiple files within a folder to transfer.sh
Any idea how to do so?
transfer * > /home/kvm1/www/uploads.txt
@omgbox commented on GitHub:
transfer() {
if [ $# -lt 1 ]; then
echo -e "URL: https://transfer.sh"
echo -e "Usage: $0 "
echo -e "Example: $0 file.zip file2.txt file3.jpg"
return 1
fi
myArray=( "$@" )
for arg in "${myArray[@]}"; do
tmpfile=$( mktemp -t transferXXX )
if tty -s; then
basefile=$(basename "$arg" | sed -e 's/[^a-zA-Z0-9._-]/-/g')
curl --progress-bar --upload-file "$arg" "https://transfer.sh/$basefile" >> $tmpfile
else curl --progress-bar --upload-file "-" "https://transfer.sh/$arg" >> $tmpfile
fi
cat $tmpfile
rm -f $tmpfile
done
}
@Arinerron commented on GitHub:
Possible duplicate? https://github.com/dutchcoders/transfer.sh/issues/35