Short form curl command could be used in the example #43

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

Originally created by @ozwaldorf on GitHub.

In the example on the site, a shorter form for --upload-file can be used instead, -T, which additionally will amend the URL with the document name. It's much simpler to type and easier to use

# Upload using cURL
$ curl -T ./hello.txt https://transfer.sh
https://transfer.sh/adjUT2e2EM/hello.txt

This also works for piping output, although you must specify the document name. Perhaps the service could support a default name for this flow:

# Upload command output
$ echo "hello world" | curl -T- https://transfer.sh/output
...
Originally created by @ozwaldorf on GitHub. In the example on the site, a shorter form for `--upload-file` can be used instead, `-T`, which additionally will amend the URL with the document name. It's much simpler to type and easier to use ``` # Upload using cURL $ curl -T ./hello.txt https://transfer.sh https://transfer.sh/adjUT2e2EM/hello.txt ``` This also works for piping output, although you must specify the document name. Perhaps the service could support a default name for this flow: ``` # Upload command output $ echo "hello world" | curl -T- https://transfer.sh/output ... ```
Author
Owner

@amayer5125 commented on GitHub:

While I agree that the filename being part of a flag and the URL may be redundant, I think using the long form of the flag in examples makes more sense. It is easier to read for people that are not familiar with a command. I've also found that using the long form of flags in scripts helps with readability when I come back to modify scripts months later.

@amayer5125 commented on GitHub: While I agree that the filename being part of a flag and the URL may be redundant, I think using the long form of the flag in examples makes more sense. It is easier to read for people that are not familiar with a command. I've also found that using the long form of flags in scripts helps with readability when I come back to modify scripts months later.
Author
Owner

@paolafrancesca commented on GitHub:

thanks @ozwaldorf for the information.

I will close the issue since its content is available anyway.
If you want to share the information in the docs, please open a PR, thanks :)

@paolafrancesca commented on GitHub: thanks @ozwaldorf for the information. I will close the issue since its content is available anyway. If you want to share the information in the docs, please open a PR, thanks :)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dutchcoders/transfer.sh#43