Open softwaremarkdahl opened 1 year ago
Pistache does not include any mime-defang logic. You'll need to write your own or use a third party library.
Thanks for the reply. I know I'll have to manage the mime in other way, but it's not clear to me if it's possible to extract the multipart binary data from the request.
I did a test here with a multipart form sending a 160KB zero-filled file and it seems ok, the non-text binary seems ok in the body.
Saving the body to analyze:
std::fstream dump("dump.bin", std::ios::out | std::ios::trunc);
dump.write(request.body().c_str(),
static_cast<std::streamsize>(request.body().size()))
<< std::endl;
Inspecting:
hexdump -vC dump.bin | less
I'm trying to receive a file upload to pistache from a web page using multipart/form-data. Pistache receive the data, but it seems to me I can only get the string data part of the body in the post. How can I retrieve the binary part (that is the file sent by the form)?