Skip to content

Instantly share code, notes, and snippets.

@sdogruyol
Created October 12, 2016 11:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sdogruyol/a531d3446a37c71544ed6f05ee84e7fa to your computer and use it in GitHub Desktop.
Save sdogruyol/a531d3446a37c71544ed6f05ee84e7fa to your computer and use it in GitHub Desktop.
struct Upload
field : String
data : IO::Delimited
meta : HTTP::FormData::FileMetadata
headers : HTTP::Headers
end
def parse_multipart(env)
HTTP::FormData.parse(env.request) do |field, data, meta, headers|
yield Upload.new field, data, meta, headers
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment