Context
PlotToon episodes upload one final image per cut, then publish markdown referencing those IPFS image URLs. A normal webtoon episode needs 10-20 image uploads in one publishing session.
Related PlotToon planning: realproject7/plottoon#44 and realproject7/plottoon#42.
Problem
The existing single-image endpoint (POST /api/upload-plot-image) has a 5/minute rate limit per wallet. A 15-cut episode would require waiting across several minutes.
Solution: Batch upload endpoint
Add POST /api/upload-plot-images (plural) instead of raising the global single-image rate limit.
Behavior
- Accepts multiple files in one FormData request (e.g.,
file_0, file_1, ... or files[])
- One wallet signature covers the entire batch
- Each file validated individually: WebP/JPEG only, max 1MB, magic byte check
- Returns ordered array of results:
[{ index, cid, url, mimeType, sizeBytes }]
- Failed individual files return error in their slot without failing the whole batch
Rate limiting
- Max 20 files per batch request
- Max 3 batch requests per minute per wallet
- Existing single-image endpoint (
/api/upload-plot-image) unchanged — keeps 5/min limit
What to skip for MVP
- No
cutId metadata field — just return results in upload order
- No
purpose field — keep it simple
Acceptance criteria
- PlotToon can upload a 10-20 cut episode in one request
- Each file individually validated (type, size, magic bytes)
- Ordered results array matches upload order
- Existing single-image illustration endpoint unchanged
- Abuse protection: batch size + rate limiting enforced
- No secrets or credentials exposed
Context
PlotToon episodes upload one final image per cut, then publish markdown referencing those IPFS image URLs. A normal webtoon episode needs 10-20 image uploads in one publishing session.
Related PlotToon planning: realproject7/plottoon#44 and realproject7/plottoon#42.
Problem
The existing single-image endpoint (
POST /api/upload-plot-image) has a 5/minute rate limit per wallet. A 15-cut episode would require waiting across several minutes.Solution: Batch upload endpoint
Add
POST /api/upload-plot-images(plural) instead of raising the global single-image rate limit.Behavior
file_0,file_1, ... orfiles[])[{ index, cid, url, mimeType, sizeBytes }]Rate limiting
/api/upload-plot-image) unchanged — keeps 5/min limitWhat to skip for MVP
cutIdmetadata field — just return results in upload orderpurposefield — keep it simpleAcceptance criteria