Missing percent-encoding of hashes (#) in returned URL #269

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

Originally created by @JustAnotherArchivist on GitHub.

When uploading a file whose name contains a hash (#), the returned URL also contains that symbol literally. This means that the returned URL will 404 although the upload itself was successful. The hash needs to be percent-encoded as %23 instead so that clients don't treat the rest of the URL as a fragment.

> curl --upload-file test#test https://transfer.sh/
https://transfer.sh/150xUz/test#test

should produce

https://transfer.sh/150xUz/test%23test

This happens regardless of whether you use a filename containing a hash with --upload-file or specify the filename in the URL like https://transfer.sh/foo%23bar (where the hash of course needs to be encoded as well so that curl doesn't strip it away).

Originally created by @JustAnotherArchivist on GitHub. When uploading a file whose name contains a hash (`#`), the returned URL also contains that symbol literally. This means that the returned URL will 404 although the upload itself was successful. The hash needs to be percent-encoded as `%23` instead so that clients don't treat the rest of the URL as a fragment. > curl --upload-file test#test https://transfer.sh/ https://transfer.sh/150xUz/test#test should produce https://transfer.sh/150xUz/test%23test This happens regardless of whether you use a filename containing a hash with `--upload-file` or specify the filename in the URL like `https://transfer.sh/foo%23bar` (where the hash of course needs to be encoded as well so that curl doesn't strip it away).
Author
Owner

@JustAnotherArchivist commented on GitHub:

Oh, I see, didn't see that. We're running our own instance, but I guess the code isn't up-to-date then. Thanks!

@JustAnotherArchivist commented on GitHub: Oh, I see, didn't see that. We're running our own instance, but I guess the code isn't up-to-date then. Thanks!
Author
Owner

@paolafrancesca commented on GitHub:

@JustAnotherArchivist it was fixed month ago on codebase. I have no control on version deployed on https://tranfer.sh

@paolafrancesca commented on GitHub: @JustAnotherArchivist it was fixed month ago on codebase. I have no control on version deployed on `https://tranfer.sh`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dutchcoders/transfer.sh#269