greasyfork icon indicating copy to clipboard operation
greasyfork copied to clipboard

File attachments in discussions

Open PYUDNG opened this issue 3 months ago • 3 comments

Hi JasonBarnabe — love the site, and appreciate all you do! Quick question: I was wondering if we could add support for more file types in discussions (like .txt, .log, .zip, .json). Is there any particular reason it's currently limited to images?

PYUDNG avatar Oct 03 '25 16:10 PYUDNG

Images were the original intention as screenshots and such are often useful in discussions. I want to specifically avoid .js as people posting user scripts in a discussion would circumvent moderation and performance optimizations that JS posted a script have. .zip and other compression formats I would also like to avoid, because they can easily contain the disallowed file types.

I don't have any objections to .txt, .log, or .json, as long as people don't end up trying to use them as resources loaded by their scripts. I would need to look into what changes are necessary as the site is set up to treat all attachments as images right now.

JasonBarnabe avatar Oct 03 '25 19:10 JasonBarnabe

You're my hero @JasonBarnabe, I'm looking forward to .txt/.json/.log attachments on greasyfork. Love you!!!

PYUDNG avatar Oct 04 '25 03:10 PYUDNG

for .zip, you can use JSZip to unzip and then filter out the non-allowed file types, and then just upload as txt/json/log/images

you might mark them with some special filenames, like ZIP___xxx-1.log, ZIP___xxx-2.txt

Then the backend engine will still store the unzipped allowed files, and send the attachment links to the frontend pages.

So in frontend, the user can directly download the zip contents. Also they can download it as zip file using fetch API and JSZip in frontend.

cyfung1031 avatar Nov 20 '25 00:11 cyfung1031