UploadResult Struct
Detailed Description
File pick + upload seam. Binary file bytes can't safely cross the core<->platform
boundary on web (Embind string marshaling) or Android (jstring/modified-UTF-8),
so rather than route an upload's bytes through http(), the platform owns the
whole operation: it opens a native file picker (filtered by accept, an HTML-
style MIME list like "image/png,image/jpeg"), then multipart-uploads the chosen
file — under form field fieldName, with the HTTP verb method (e.g. "POST" for
post attachments, "PUT" for a profile picture) — to url with headers (e.g. an
Authorization bearer), and delivers the API's JSON reply back as a string. The
binary never enters the core; only the response text does. Per-platform shells
inject the transport at startup (desktop QFileDialog+QHttpMultiPart, web
+FormData/fetch, Android SAF+OkHttp). Backs attachment uploads
(POST {profile}/api/uploads) and the profile picture (PUT {profile}/api/profile/
picture). [Attachments]
Member Variable Documentation
bool canceled = false
user dismissed the picker (no upload attempted)
int status = 0
HTTP status of the upload POST (0 = transport fail)
std::string body
the API's JSON reply (when status != 0)
std::string error
transport/error detail; "" on success