chriskuehl / fluffy

A file-sharing web app that doesn't suck.
https://fluffy.cc
Other
175 stars 22 forks source link

normalize .html and .txt urls #176

Closed magicmark closed 2 months ago

magicmark commented 2 months ago

for big json dumps, loading the page can take forever and crash the browser, and i usually just want to curl it anyway

but if folks provide me the .html page, i can't easily map to the .txt url

could they share the same id in the url?

magicmark commented 2 months ago

i see the comment from here https://github.com/chriskuehl/fluffy/issues/62#issuecomment-367505197 which makes sense, but somewhere in def upload(): can we generate an id and share it with the plaintext and html file in s3?

chriskuehl commented 2 months ago

I think we could make the HTML and TXT files have the same name (other than extension of course).

Just to be clear, technically an upload can produce multiple HTML files and TXT files. For example https://i.fluffy.cc/PPMCfvrXGF1fhGWjs6lKqfLn21xHB7HB.html has five files (not counting the JSON files):

If the file1 txt+html and the file2 txt+html had the same name, that would do what you want?

magicmark commented 2 months ago

heck yeah!

Screenshot 2024-08-20 at 4 11 46 PM

so 'direct link' and 'view text' would be the same url, apart from the suffix

chriskuehl commented 2 months ago

I think https://github.com/chriskuehl/fluffy/pull/177 will do it. I'm traveling at the moment but I'll test this more thoroughly and merge it soon.

chriskuehl commented 2 months ago

Released in v1.40.0.

Here's an example on the new version: https://i.fluffy.cc/pLRkPrVHQdjqXg5697pwcncxs3VG9Bkv.html