5 * 1024 * 1024) { api_error(422, 'FILE_TOO_LARGE', 'Die Datei ist zu groß (max. 5 MB).'); } $result = handle_ticket_upload($file); if (isset($result['error'])) { api_error(422, 'UPLOAD_FAILED', $result['error']); } audit_log($staff['id'], "Bild hochgeladen: {$result['stored_name']} (Mobile App)"); api_json([ 'url' => base_url() . '/uploads/' . $result['stored_name'], ]);