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

File: add support for File/UploadedFile types #103

Open
gi opened this issue Sep 29, 2020 · 0 comments · May be fixed by #104
Open

File: add support for File/UploadedFile types #103

gi opened this issue Sep 29, 2020 · 0 comments · May be fixed by #104

Comments

@gi
Copy link

gi commented Sep 29, 2020

It would be nice to have support for uploaded files:

param :file, File

This would coerce the parameter into an object that conforms to Rack::Multipart::UploadedFile.

gi added a commit to gi/sinatra-param that referenced this issue 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 mattt#103
@gi gi linked a pull request Oct 2, 2020 that will close this issue
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 a pull request may close this issue.

1 participant