backstage-plugin-qeta icon indicating copy to clipboard operation
backstage-plugin-qeta copied to clipboard

Can't upload non image types - e.g PDF/PPTX for Articles

Open veenarm opened this issue 7 months ago • 9 comments

It seems that only accept="image/*" is preventing the ability to upload non images to Articles.

Attempted to add mimetype acceptances of pdf and pptx however they are rejected.

Feat:

  • Add ability to allow any file type as long as it matches the mime type override.
  • Separation so image only for QETA however allow others for Articles.

veenarm avatar May 08 '25 11:05 veenarm

Hi,

The issue with other mimetypes is that the rendering will totally break, so they should be handled properly in the UI as well, not just in the backend.

drodil avatar May 08 '25 12:05 drodil

Oh right, it renders it in the output :\

I guess links to download the file if non image could work?

veenarm avatar May 08 '25 12:05 veenarm

Yeah, probably something like that but requires some tinkering 😁

If anyone is up to contribute, it would be awesome!

drodil avatar May 08 '25 13:05 drodil

Did you try adding the mimetypes to config qeta.storage.allowedMimeTypes and see how it renders? I think it probably still tries to render it as a image because it's added in the markdown as image. But modifying the markdown to make it a link instead might work 🤔

drodil avatar May 08 '25 14:05 drodil

I did change the mimeTypes but it still disallows the file to be uploaded due to the accept="image/*" so it never attempted a render.

I'll have to clone the repo and test some minor changes see best way to push forward.

veenarm avatar May 08 '25 22:05 veenarm

@veenarm oh true, it should be configured to the frontend as well. If you come up with a solution, I would be more than happy to accept a PR! I can also take a look at some point but it might be weeks from now as I am quite busy at the moment (you know, getting the world ready before summer 😁)

drodil avatar May 09 '25 05:05 drodil

@veenarm checked this a bit and the accept=image/* is only in the header image input. It should be possible to upload other files in the article content if you have the qeta.storage.allowedMimeTypes config supporting that.

drodil avatar May 13 '25 07:05 drodil

Can I work on this, please?

BlessingEmejulu avatar May 14 '25 03:05 BlessingEmejulu

@BlessingEmejulu sure!

drodil avatar May 14 '25 04:05 drodil

@veenarm can you try with the latest release? I think I made it more understandable how to upload stuff

drodil avatar Jun 17 '25 17:06 drodil

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Aug 16 '25 18:08 github-actions[bot]

Tested the lastest version, and it only accepts images in both articles and q&a - mostly due to the way it's designed which is fine.. Maybe instead a feature could be to add a 'add documents to articles?'

veenarm avatar Aug 17 '25 09:08 veenarm

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Oct 16 '25 10:10 github-actions[bot]