Module: Rack::Multipart
- Defined in:
- lib/rack/multipart.rb,
lib/rack/multipart/parser.rb,
lib/rack/multipart/generator.rb,
lib/rack/multipart/uploaded_file.rb
Overview
A multipart form data parser, adapted from IOWA.
Usually, Rack::Request#POST takes care of calling this.
Defined Under Namespace
Classes: Generator, MultipartPartLimitError, Parser, UploadedFile
Constant Summary collapse
- EOL =
"\r\n"
- MULTIPART_BOUNDARY =
"AaB03x"
- MULTIPART =
%r|\Amultipart/.*boundary=\"?([^\";,]+)\"?|ni
- TOKEN =
/[^\s()<>,;:\\"\/\[\]?=]+/
- CONDISP =
/Content-Disposition:\s*#{TOKEN}\s*/i
- DISPPARM =
/;\s*(#{TOKEN})=("(?:\\"|[^"])*"|#{TOKEN})/
- RFC2183 =
/^#{CONDISP}(#{DISPPARM})+$/i
- BROKEN_QUOTED =
/^#{CONDISP}.*;\sfilename="(.*?)"(?:\s*$|\s*;\s*#{TOKEN}=)/i
- BROKEN_UNQUOTED =
/^#{CONDISP}.*;\sfilename=(#{TOKEN})/i
- MULTIPART_CONTENT_TYPE =
/Content-Type: (.*)#{EOL}/ni
- MULTIPART_CONTENT_DISPOSITION =
/Content-Disposition:.*\s+name="?([^\";]*)"?/ni
- MULTIPART_CONTENT_ID =
/Content-ID:\s*([^#{EOL}]*)/ni