Rewriting a "multipart/form-data" request to a "binary" "x-www-form-urlencoded" request

Hi, everyone!

I would like to know if there’s a simple way to have Nginx rewrite a
“multipart/form-data” request to a “x-www-form-urlencoded” request with
only a (binary) file as the content.

That is, I want the rewritten request to look like it was produced with
Curl --data-binary option.

The reason I want to do this is because I’m working with a backend
that only supports this file encoding.

Thanks in advance!

All the best,