How to parse multipart form-data in ulfius ? In the request one is XML file and other is Json String #198
-
curl -v -i -H "Content-Type:multipart/form-data" -F "upload=@pm_omes.xml;type=application/xml" -F "data=@pm.json;type=application/json" http://localhost:8082/FaultManagerService/sendAlarms |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
The File Upload paragraph in the API documentation might help you. When a file is sent in multipart form-data, the file is available in the If you expect large files to be uploaded, you can also use |
Beta Was this translation helpful? Give feedback.
The File Upload paragraph in the API documentation might help you.
When a file is sent in multipart form-data, the file is available in the
request->map_post_body
as filename (key) => file_content (value), so if you send multiple files in a request, all of them will be available in therequest->map_post_body
.If you expect large files to be uploaded, you can also use
ulfius_set_upload_file_callback_function
to intercept file uploads before they are parsed by the framework.