Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
jtoy opened this issue Sep 10, 2016 · 5 comments
Closed

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

jtoy opened this issue Sep 10, 2016 · 5 comments

Comments

@jtoy
Copy link

jtoy commented Sep 10, 2016

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?

@nl5887
Copy link
Member

nl5887 commented Sep 11, 2016

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.

@jtoy
Copy link
Author

jtoy commented Sep 12, 2016

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.

@nl5887
Copy link
Member

nl5887 commented Sep 13, 2016

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

@jtoy
Copy link
Author

jtoy commented Sep 25, 2016

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

@nl5887
Copy link
Member

nl5887 commented Sep 25, 2016

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 nl5887 closed this as completed Mar 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants