goploader
goploader copied to clipboard
Uploaded text downloads as STDIN
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 👍
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 👍
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
I was talking about only the text upload when you write stuff in the field.
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 :) )
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 🤔
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
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 ?
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 :)
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.