Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add File as valid param type #104

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

gi
Copy link

@gi gi commented Oct 2, 2020

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: the Tempfile created from the content of the multipart request
  • type: the content media/MIME type

Fixes #103

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`: the `Tempfile` created from the content of the multipart request
- `type`: the content media/MIME type

Fixes mattt#103
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

File: add support for File/UploadedFile types
1 participant