Skip to content

How to parse multipart form-data in ulfius ? In the request one is XML file and other is Json String #198

Answered by babelouest
KarurNaveen asked this question in Q&A
Discussion options

You must be logged in to vote

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 the request->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.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@KarurNaveen
Comment options

@babelouest
Comment options

Answer selected by babelouest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants