mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-14 04:10:24 +00:00
Update the multipart reading interface
Now named read_part/read_part_body, with a verb indicating action.
This commit is contained in:
parent
ae95e87eb1
commit
aa6f2ab5a4
5 changed files with 38 additions and 36 deletions
|
@ -6,8 +6,8 @@
|
|||
-export([init/2]).
|
||||
|
||||
init(Req, Opts) ->
|
||||
{ok, Headers, Req2} = cowboy_req:part(Req),
|
||||
{ok, Data, Req3} = cowboy_req:part_body(Req2),
|
||||
{ok, Headers, Req2} = cowboy_req:read_part(Req),
|
||||
{ok, Data, Req3} = cowboy_req:read_part_body(Req2),
|
||||
{file, <<"inputfile">>, Filename, ContentType, _TE}
|
||||
= cow_multipart:form_data(Headers),
|
||||
io:format("Received file ~p of content-type ~p as follow:~n~p~n~n",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue