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

favor req.file(name) over req.param(name).toUpload #819

Closed
jknack opened this issue Jun 18, 2017 · 0 comments
Closed

favor req.file(name) over req.param(name).toUpload #819

jknack opened this issue Jun 18, 2017 · 0 comments
Milestone

Comments

@jknack
Copy link
Member

jknack commented Jun 18, 2017

We do provide two way of accessing file uploads today via req.param(name) or req.file(name).

We want to be more explicit so the req.param will stop working for file uploads.

req.param(name).toUpload() becomes req.file(name)

req.param(name).to(Upload.class) becomes req.file(name)

req.param(name).toList(Upload.class) becomes req.files(name)

req.param(name).toOptional(Upload.class) becomes req.ifFile(name)

Please keep in mind the req.file and req.files methods already exists.

This is a break change that affect all script routes that were using .param to retrieve file uploads. MVC routes will keep working (won't break)

@jknack jknack modified the milestones: 1.1.3, 1.2.0 Jun 18, 2017
jknack added a commit that referenced this issue Jun 23, 2017
Optional Upload with malformed file multipart part fix #803
jknack added a commit that referenced this issue Jun 23, 2017
Optional Upload with malformed file multipart part fix #803
jknack added a commit that referenced this issue Jun 29, 2017
Optional Upload with malformed file multipart part fix #803
@jknack jknack closed this as completed in cbec59d Jul 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant