aboutsummaryrefslogtreecommitdiffstats
path: root/examples/upload/src/upload_handler.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2016-08-10 15:09:04 +0200
committerLoïc Hoguin <[email protected]>2016-08-10 15:09:04 +0200
commitaa6f2ab5a48d90e47648dfb53e0894dcaa6f6aac (patch)
tree591db3bbed44577d9b87e8d07dde7454ce862207 /examples/upload/src/upload_handler.erl
parentae95e87eb1c352b96b43a431fd4693d7d80a4b64 (diff)
downloadcowboy-aa6f2ab5a48d90e47648dfb53e0894dcaa6f6aac.tar.gz
cowboy-aa6f2ab5a48d90e47648dfb53e0894dcaa6f6aac.tar.bz2
cowboy-aa6f2ab5a48d90e47648dfb53e0894dcaa6f6aac.zip
Update the multipart reading interface
Now named read_part/read_part_body, with a verb indicating action.
Diffstat (limited to 'examples/upload/src/upload_handler.erl')
-rw-r--r--examples/upload/src/upload_handler.erl4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/upload/src/upload_handler.erl b/examples/upload/src/upload_handler.erl
index dec634d..08bca6f 100644
--- a/examples/upload/src/upload_handler.erl
+++ b/examples/upload/src/upload_handler.erl
@@ -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",