Skip to content

⚡️⚡️⚡️ Self-hosted collaborative bookmark manager to collect, read, annotate, and fully preserve what matters, all in one place.

support png uploads for banners

daniel31x132f3f6c4b51ab
diff --git a/apps/web/components/LinkDetails.tsx b/apps/web/components/LinkDetails.tsx
index f0ab4531..84553d75 100644
--- a/apps/web/components/LinkDetails.tsx
+++ b/apps/web/components/LinkDetails.tsx
@@ -195,7 +195,7 @@ export default function LinkDetails({
{t("upload_banner")}
<input
type="file"
- accept="image/jpg, image/jpeg"
+ accept="image/jpg, image/jpeg, image/png"
onChange={async (e) => {
const file = e.target.files?.[0];
if (!file) return;
diff --git a/apps/web/pages/api/v1/archives/[linkId].ts b/apps/web/pages/api/v1/archives/[linkId].ts
index cf148ebe..6df3637b 100644
--- a/apps/web/pages/api/v1/archives/[linkId].ts
+++ b/apps/web/pages/api/v1/archives/[linkId].ts
@@ -233,7 +233,9 @@ async function handlePost(req: NextApiRequest, res: NextApiResponse) {
[ArchivedFormat.monolith]: ["text/html"],
};
- const allowedMIMETypes = allowedMIMETypesByFormat[format] ?? [];
+ const allowedMIMETypes = isPreview
+ ? ["image/png", "image/jpg", "image/jpeg"]
+ : allowedMIMETypesByFormat[format] ?? [];
const fileBuffer = validateFile(
files.file[0],