remove need for file name on upload, simplify API #361

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

Originally created by @jtoy on GitHub.

the way to upload is with a command like:
curl --upload-file ./hello.txt https://transfer.sh/foo.txt

why do we need to set foo.txt ?
why can't it be something like:
curl --upload-file ./hello.txt https://transfer.sh/upload
the actual link of the fileis returned anyway so setting foo.txt doesn't help. It seems like a needlessly complex interface. Or am I missing something?

Originally created by @jtoy on GitHub. the way to upload is with a command like: curl --upload-file ./hello.txt https://transfer.sh/foo.txt why do we need to set foo.txt ? why can't it be something like: curl --upload-file ./hello.txt https://transfer.sh/upload the actual link of the fileis returned anyway so setting foo.txt doesn't help. It seems like a needlessly complex interface. Or am I missing something?
Author
Owner

@nl5887 commented on GitHub:

Previous week I updated transfer.sh. You should be able to upload files without a filename now. Btw curl will append the filename of the uploaded file by default.

curl --upload-file /tmp/wifi-5m260z.log https://transfer.sh/
https://transfer.sh/168UV7/wifi-5m260z.log
@nl5887 commented on GitHub: Previous week I updated transfer.sh. You should be able to upload files without a filename now. Btw curl will append the filename of the uploaded file by default. ``` curl --upload-file /tmp/wifi-5m260z.log https://transfer.sh/ https://transfer.sh/168UV7/wifi-5m260z.log ```
Author
Owner

@jtoy commented on GitHub:

@nl5887 check out file.io's api, no need to upload the file name also:
https://www.file.io/#one
$ curl -F "file=@test.txt" https://file.io
{"success":true,"key":"2ojE41"}
$ curl https://file.io/2ojE41
This is a test
$ curl https://file.io/2ojE41
{"success":false,"error":404,"message":"Not Found"}

@jtoy commented on GitHub: @nl5887 check out file.io's api, no need to upload the file name also: https://www.file.io/#one $ curl -F "file=@test.txt" https://file.io {"success":true,"key":"2ojE41"} $ curl https://file.io/2ojE41 This is a test $ curl https://file.io/2ojE41 {"success":false,"error":404,"message":"Not Found"}
Author
Owner

@nl5887 commented on GitHub:

When using --upload-file the file will be send as body, without any Content-Type or filename hints. That's the reason to send the filename with the request.

@nl5887 commented on GitHub: When using `--upload-file` the file will be send as body, without any Content-Type or filename hints. That's the reason to send the filename with the request.
Author
Owner

@nl5887 commented on GitHub:

I'm planning an upgrade with a lot of issues fixed and enhancements, will take this into account as well.

@nl5887 commented on GitHub: I'm planning an upgrade with a lot of issues fixed and enhancements, will take this into account as well.
Author
Owner

@jtoy commented on GitHub:

I see, would it be useful if we generated a fake file name and extension if no file name was provided? That way we at least give the user the option of not having to double type the name every time.

@jtoy commented on GitHub: I see, would it be useful if we generated a fake file name and extension if no file name was provided? That way we at least give the user the option of not having to double type the name every time.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dutchcoders/transfer.sh#361