sinatra-param
sinatra-param copied to clipboard
Add `File` as valid param type
With a type declaration of File, the input parameter hash of the uploaded
file is coerce into a new UploadedFile object which conforms to the
Rack::Multipart::UploadedFile interface.
The input parameter hash must be of the shape:
-
filename: the original file name of the uploaded file -
head: the header lines of the multipart request -
name: the parameter name -
tempfile: theTempfilecreated from the content of the multipart request -
type: the content media/MIME type
Fixes #103