0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-14 04:10:24 +00:00

Make cowboy_req:read_part return multipart headers as map

This commit is contained in:
Loïc Hoguin 2017-06-09 16:57:11 +02:00
parent 6f7b59886e
commit ec00e3d60e
No known key found for this signature in database
GPG key ID: 71366FF21851DF03
5 changed files with 19 additions and 20 deletions

View file

@ -8,7 +8,7 @@
init(Req, Opts) ->
{ok, Headers, Req2} = cowboy_req:read_part(Req),
{ok, Data, Req3} = cowboy_req:read_part_body(Req2),
{file, <<"inputfile">>, Filename, ContentType, _TE}
{file, <<"inputfile">>, Filename, ContentType}
= cow_multipart:form_data(Headers),
io:format("Received file ~p of content-type ~p as follow:~n~p~n~n",
[Filename, ContentType, Data]),