From 0c945405e3794e7b1e7042a5cc25a1e8fbc7cf79 Mon Sep 17 00:00:00 2001 From: fahed Date: Tue, 24 Feb 2026 14:10:41 +0300 Subject: [PATCH] fix: use api.upload() for artefact file attachments api.post() was setting Content-Type to application/json and JSON.stringifying the FormData, which destroyed the file data and caused "Either file upload or drive_url is required" error. Co-Authored-By: Claude Opus 4.6 --- client/src/pages/Artefacts.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/pages/Artefacts.jsx b/client/src/pages/Artefacts.jsx index a4389b5..c0f0284 100644 --- a/client/src/pages/Artefacts.jsx +++ b/client/src/pages/Artefacts.jsx @@ -710,7 +710,7 @@ function ArtefactDetailPanel({ artefact, onClose, onUpdate, onDelete, projects = try { const formData = new FormData() formData.append('file', file) - await api.post(`/artefacts/${artefact.Id}/versions/${selectedVersion.Id}/attachments`, formData) + await api.upload(`/artefacts/${artefact.Id}/versions/${selectedVersion.Id}/attachments`, formData) toast.success('File uploaded') loadVersionData(selectedVersion.Id) } catch (err) {