๐ผ๏ธ 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: imageResponse:
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.jpgNo authentication is required to view uploaded images.
๐จ Accepted Formats โ
| Format | MIME Type |
|---|---|
| JPEG | image/jpeg |
| PNG | image/png |
| WebP | image/webp |
| GIF | image/gif |
๐ Limits โ
| Constraint | Value |
|---|---|
| ๐ฆ Max file size | 5 MB |
| ๐ค Naming | UUID-based (no filename collisions) |
๐ Permissions โ
| Action | Who Can Do It |
|---|---|
| โฌ๏ธ Upload image | Manager, Super Admin |
| ๐๏ธ Delete image | Manager, Super Admin |
| ๐๏ธ View image | Anyone |
โ๏ธ Configuration โ
See File Uploads for storage configuration and Docker volume setup.