DEV Community

Daniil
Daniil

Posted on

Erlang, send file with httpc:request multipart/form-data

Good afternoon, to everyone who reads my letter. I wish you a good day!

I am a beginner Erlang developer, and faced with a problem when sending a file, a picture using httpc:request, I have read a lot of things on the Internet, but did not find a concrete answer on the Internet.

My problem is that I do not quite understand what parameters I need to pass in the body of the request for the server to process my file. If you are reading this and have encountered this problem, but you know some article, please attach it in the comments.

The second problem is that I send my file to the server, and when my file request arrives, its body is sent to the validator, which checks for the "inputfile" key with a value of type file, and also "inputfile_filename" with a value of type string. And I do not understand how to put in one request and sending a picture, and maps with inputfile and inputfile_filename to correctly process my request to the server.

I would be grateful for any help, advice or a link to an article about multipart/form-data.

Once again I wish you a good mood and a good day.

Top comments (0)