mirror of
https://github.com/dutchcoders/transfer.sh.git
synced 2026-02-03 14:13:26 +00:00
Can't upload files with spaces in filename #71
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 @mpr1255 on GitHub.
Problem is simple. This works:
echo 'hello' > test1.txt && transfer test1.txtThis doesn't:
echo 'hello' > "Test 2.txt" && transfer "Test 2.txt"Update: I just asked GPT-4 and it proposed this solution which I trialed and it works well. I also got it to fix it for bash & zsh compatibility.
The key was just the URL encoding function so instead of passing the filename straight, it encodes it. Neat!
@paolafrancesca commented on GitHub:
@mpr1255 this was reported in https://github.com/dutchcoders/transfer.sh/issues/483 and have an alternative shell function at https://github.com/dutchcoders/transfer.sh#bash-and-zsh-with-delete-url-delete-token-output-and-prompt-before-uploading
the
transfershell function in the frontend was not fixed.there's no need to urlencode the filename, not providing a filename and using the file and not stdin for
--upload-file(without thecat $file|) is enough:I would rather go for this solution, since it decreases a lot the overall complexity of the function