Skip to content

Support PlotToon-friendly multi-image upload limits #1213

@realproject7

Description

@realproject7

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions