Skip to content

๐Ÿ–ผ๏ธ Image Uploads โ€‹

KitchenAsty supports image uploads for menu items via a multipart form data API.

โฌ†๏ธ Upload an Image โ€‹

POST /api/menu/items/:id/image
Authorization: Bearer <staff-token>
Content-Type: multipart/form-data

Form field: image

Response:

json
{
  "success": true,
  "data": {
    "id": "item-id",
    "image": "/uploads/a1b2c3d4-e5f6-7890-abcd-ef1234567890.jpg"
  }
}

๐Ÿ—‘๏ธ Delete an Image โ€‹

DELETE /api/menu/items/:id/image
Authorization: Bearer <staff-token>

Removes the image file from disk and clears the image field on the menu item.

๐ŸŒ Serving Images โ€‹

Uploaded images are served statically at /uploads/:

GET /uploads/a1b2c3d4-e5f6-7890-abcd-ef1234567890.jpg

No authentication is required to view uploaded images.

๐ŸŽจ Accepted Formats โ€‹

FormatMIME Type
JPEGimage/jpeg
PNGimage/png
WebPimage/webp
GIFimage/gif

๐Ÿ“ Limits โ€‹

ConstraintValue
๐Ÿ“ฆ Max file size5 MB
๐Ÿ”ค NamingUUID-based (no filename collisions)

๐Ÿ” Permissions โ€‹

ActionWho Can Do It
โฌ†๏ธ Upload imageManager, Super Admin
๐Ÿ—‘๏ธ Delete imageManager, Super Admin
๐Ÿ‘๏ธ View imageAnyone

โš™๏ธ Configuration โ€‹

See File Uploads for storage configuration and Docker volume setup.