it's a straight copy from https://github.com/defnull/multipart