Cowboy 0.9 release and master branch support different multipart request data processing APIs. Cowboy is a good erlang http library. But the author did not provide enough sample projects and user guides about http file upload processing.
This sample project provides a http file upload sample.
Reference to the user guide cowboy multipart request manual in cowboy master branch.
This sample followed up cowboy sample project packaging rules.
-
clone this project
> git clone https://github.com/yaocl/cowboy_fileupload.git
-
compilation
> make
It will get the dependent projects including cowboy, cowlib, ranch and the tool: relx.
-
run
> _rel/bin/upload_example console
-
testing
Browse the web page http://localhost:8000/