Documentation is available at https://mikedilger.github.io/formdata
This library provides a function for parsing a stream in multipart/form-data
format. It separates embedded files and streams them to disk.
HTML forms with enctype=multipart/form-data POST their data in this
format. This enctype is used whenever a form has file upload input fields,
as the default application/x-www-form-urlencoded cannot handle file
uploads.
``rust
//headersis yourhyper::headers::Headersfrom your hyper or iron request.
//request` is the readable stream, and can be the hyper or iron request itself.
let boundary = try!(getmultipartboundary(&headers)); let formdata = try!(parsemultipart(&mut request, boundary));
for (name, value) in form_data.fields { println!("Posted field name={} value={}",name,value); }
for (name, file) in formdata.files { println!("Posted file name={} filename={} contenttype={} size={} temporarypath={}", name, file.filename, file.contenttype, file.size, file.path); }
```