Multiple Files? #380

Closed
opened 2026-01-19 18:30:06 +00:00 by michael · 2 comments
Owner

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

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
Author
Owner

@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
}

@omgbox commented on GitHub: transfer() { if [ $# -lt 1 ]; then echo -e "URL: https://transfer.sh" echo -e "Usage: $0 <filename>" 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 }
Author
Owner

@Arinerron commented on GitHub:

Possible duplicate? https://github.com/dutchcoders/transfer.sh/issues/35

@Arinerron commented on GitHub: Possible duplicate? https://github.com/dutchcoders/transfer.sh/issues/35
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dutchcoders/transfer.sh#380