valum-framework / valum

Web micro-framework written in Vala
https://valum-framework.readthedocs.io/en/latest/
GNU Lesser General Public License v3.0
225 stars 23 forks source link

Upload middleware #157

Closed arteymix closed 7 years ago

arteymix commented 8 years ago

A very simple middleware to upload the request body into a file named against the Content-Disposition header.

With #105, a upload_multipart middleware should be provided to upload all parts of the message in separate files.

arteymix commented 8 years ago

Just a note: only attachment should be uploaded from multipart messages. If possible, reconstruct the message body for the next middleware.

app.get ("", upload_multipart (File.new_for_path ("upload"))).then ((req, res) => {
    // req contains form data, attachements are stripped :)
});

It might also be nice to have a middleware that extract multipart/form-data and forward a HashTable or some multimap data structure.

arteymix commented 7 years ago

I think we're good with multipart stream support now.