opengist icon indicating copy to clipboard operation
opengist copied to clipboard

Improve the support of uploading & showing binary files

Open yqs112358 opened this issue 1 year ago • 2 comments

(🤔 Maybe this isn't a suggestion that fits the purpose of this project very well, but) I've found that opengist can upload binaries (such as PDF files) via git push normally, and they're accessible after uploading. So, it might be meaningful to improve the support to binary files along the way, which is very useful to share texts with friends or to other devices along with some binary items.

Some possible improvements:

  • Determine whether the file is a binary file. (Use something like https://github.com/h2non/filetype?) If so, do not display its content in the gist page to avoid jamming the browser.
  • Support uploading or deleting binary files directly in the edit page of opengist. (Just add an upload button?)
  • For binary files, the "Raw File" button returns the content of the file directly as application/octet-stream instead of displaying it as text.

yqs112358 avatar Nov 15 '24 09:11 yqs112358

We should discuss if we need binary files in the first place, if yes which types? At it's core I believe Opengist should stay a simple pastebin but it can be always useful to have something like a PDF or an embedded image.

thomiceli avatar Nov 17 '24 17:11 thomiceli

  • Determine whether the file is a binary file. (Use something like https://github.com/h2non/filetype?) If so, do not display its content in the gist page to avoid jamming the browser.

I think at least this point would be a very good feature. Currently I also have some PDFs in my gists and displaying them as raw text sometimes leads to a lot of scrolling.

  • Support uploading or deleting binary files directly in the edit page of opengist. (Just add an upload button?)

Deleting of binary files is already possible when editing a gist. But like in the normal view they are displayed like a text file. An upload button would be a nice feature but not a must-have.

  • For binary files, the "Raw File" button returns the content of the file directly as application/octet-stream instead of displaying it as text.

I think this can be implemented together with the first point.

mammo0 avatar Nov 27 '24 08:11 mammo0

but it can be always useful to have something like a PDF or an embedded image.

Just discovered OpenGist and am deligted with it, thank you very much indeed!

I've been trying to upload binary files (JPEG and PNG) and while they can be downloaded they do look quite messy in the gist itself. What works well enough are small SVG files.

Is there hope for having support for JPEG/PNG images viewable within the gists?

Background: I intend using OpenGist in a training scenario, where students can take notes and/or I add notes which students can later look at. What would be very practical here is for photos of flipcharts etc. being able to be uploaded and viewable within the gist.

jpmens avatar Jul 16 '25 19:07 jpmens