feat(api): direct multipart upload endpoints for filesystem backend #136
Reference in New Issue
Block a user
Delete Branch "feat-direct-upload"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Add direct multipart upload endpoints that bypass the MinIO presigned URL flow, enabling the filesystem storage backend to handle file uploads.
Backend
POST /api/items/{pn}/files/upload— multipart file upload, writes to storage, creates DB record withstorage_backendPOST /api/items/{pn}/thumbnail/upload— multipart thumbnail upload, writes to storage, updatesthumbnail_keyin DBGET /api/items/{pn}/files/{fileId}/download— streams file from storage withContent-Disposition: attachmentheaderstorageBackend()reads configured backend from configFrontend
useFileUpload.ts: presign+XHR PUT → direct multipart FormData POST via XHR (progress tracking preserved)CreateItemPane.tsx: files held in browser memory on drop, uploaded after item creation via new endpointsBackward compatibility
The old presign + associate endpoints (
POST /api/uploads/presign,POST /api/items/{pn}/files,PUT /api/items/{pn}/thumbnail) remain functional for MinIO deployments.Closes #129
Add three new endpoints that bypass the MinIO presigned URL flow: - POST /api/items/{pn}/files/upload — multipart file upload - POST /api/items/{pn}/thumbnail/upload — multipart thumbnail upload - GET /api/items/{pn}/files/{fileId}/download — stream file download Rewrite frontend upload flow: files are held in browser memory on drop and uploaded directly after item creation via multipart POST. The old presign+associate endpoints remain for MinIO backward compatibility. Closes #129