matze / wastebin

wastebin is a pastebin 📝
https://bin.bloerg.net
MIT License
303 stars 28 forks source link

Download "burn after reading" file #26

Open molchalin opened 1 year ago

molchalin commented 1 year ago

Problem: 1) Create "burn after reading" file 2) Open it 3) Press button "Download" Result: 404 Want: Download this file

matze commented 1 year ago

Hmm, content is deleted after the first GET, i.e. as soon as you open it. Once done, it's wiped from the database. Keeping it somewhat alive is possible but leads to an ugly architecture. How about adding a download link next to the open link?

molchalin commented 1 year ago

I think there are two ways to go:

  1. Keep somewhere in localstorage file after get. On download you can just get store it to a file.
  2. As you said. Add download button to share page and remove "download" button for view.

I think that first approach is better. Because if you choose the second approach, you can get the same issue if you just press download button when the paste is already expired. But I don't know whether it's easy to implement

kamaradski commented 2 months ago

if i would be looking to solve this problem, i would start looking into a client side clipboard function, so to take the screen contents and put it in the user clipboard. This would be fairly easy with javascript for example.

however isn't downloading the content defeating the burn-after-reading effect? I mean it's no longer burned if it is allowed to exist on your hard drive. I know it's easy to grab content off a website/screen, but maybe don't make it too easy for endusers otherwise noone will continue to use the burn-after-reading feature.

I like the way it is right now, and if you want to keep the contents you have 3 easy ways to do it:

Personally i read the OP post and think: That 404 is misleading and than go proceed to implement the following:

I think this is mostly a philosophical problem rather than a technical one.