Skip to content

[Bug] - Image upload error when filename contains space #31

@Jalen-Stephens

Description

@Jalen-Stephens

Description

Uploading an image fails when the original filename contains a space (e.g., "My Photo.png").
Supabase receives the path but rejects the request due to an unencoded space in the storage key, causing the signed URL download step to fail during analysis.


Steps to Reproduce

  1. Open the image upload endpoint (/api/images/upload)

  2. Select a file whose name contains a space (e.g., test image.png)

  3. Submit

  4. Observe that:

    • Upload may appear successful initially
    • Later, analysis fails with C2PA tool failed or a 404 from Supabase signed URL

Expected Behavior

File upload and subsequent analysis should succeed even when filenames include spaces. The storage path should be sanitized or URL-safe encoded before persistence.


Actual Behavior

  • Supabase stores the object using raw name (with space)
  • Signed download URL becomes invalid when re-requested
  • Analysis workflow throws an exception during retrieval

Root Cause

Storage path is persisted without normalization/encoding. Supabase requires URL-safe object keys when later generating signed URLs.


Proposed Fix

  • Normalize or percent-encode filenames before upload (space → %20), OR
  • Strip unsafe characters from storage path and store canonical name

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions