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

Uploaded text downloads as STDIN #54

Open
rka opened this issue Aug 30, 2017 · 8 comments
Open

Uploaded text downloads as STDIN #54

rka opened this issue Aug 30, 2017 · 8 comments

Comments

@rka
Copy link

rka commented Aug 30, 2017

Hello again i know i asked way back for this feature. But can we have an exeption so that files download as files (no browser open), but uploaded text still opens in the browser?
Turns out this feature is awesome for sharing passwords but its a bit problematic to explain ppl every time :)

Thanks for your hard work 👍

@depado
Copy link
Owner

depado commented Aug 30, 2017

Hi,
I'd have to think about the way to do that. I would have to add a field in the database so I know if it was a file or stdin, because right now there is no differentiation between those two.
I'll have a look in an hour or so 👍

@depado
Copy link
Owner

depado commented Nov 21, 2017

Just so I can get some clarification : You never want to display the file in browser ? Always download ? Or is that some special case for just files uploaded from stdin ?
Because there's already a always_download setting that allows to never display the content in browser and always offer to download the file. Also if you don't want your file to be named "stdin", simply use the -n/--name flag using the client or curl -F name="myfile.txt" ... as shown in the docs about curl

@rka
Copy link
Author

rka commented Nov 21, 2017

I was talking about only the text upload when you write stuff in the field.

image

The new function where you can set how it will display it is awesome btw (It could simply solve this one too) its just a little confusing when you can set those to file uploads too. (I can imagine users setting it to display a pdf as markup for example hence my other issue #58 )

I will check out what you wrote to #58 and try to add it like you explained (never programmed before :) )

@depado
Copy link
Owner

depado commented Nov 21, 2017

Maybe I could just add an option in the upload form to say "this is a file named xxx and I never want it to be displayed in the browser" ? In such a case, I could add a field in the database and prevent the formatting (syntax highlighting, line numbers and theme) when the upload is completed and when the file is retrieved ?

I'll design a poc when I can and show it to you so you can validate if that fixes your use case 🤔

@rka
Copy link
Author

rka commented Nov 21, 2017

im not sure i understand. What i try to achieve is:

  • files would not be opened by browser (this works good when i set the always download option)

  • text uploaded would show in browser (with aweseome new functions :) )

Im sorry if i misunderstood you

@depado
Copy link
Owner

depado commented Nov 21, 2017

Oh I see !
I don't know if that's possible as I have no way to know how the file was uploaded. I think I can just check for the filename and if it's stdin then show them in browser. But that would require that stdin is never changed, as soon as you give your file another name it would download. Sounds good ?

@rka
Copy link
Author

rka commented Nov 21, 2017

Oh i didnt know that.
So when i upload text (write stuff in the field like in the picture) it uploads as stdin?

Cool sounds gr8 :)

@depado
Copy link
Owner

depado commented Nov 21, 2017

Yes I think. Just as when you upload from the command line, as there is no way for me to determine the name of the file you're trying to upload (since it's not a file but a stream), I name it stdin.

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