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

[V2] [File upload] Access file size, mime type, encoding and original file name #730

Merged
merged 10 commits into from
May 29, 2020

Conversation

LoicPoullain
Copy link
Member

@LoicPoullain LoicPoullain commented May 28, 2020

Issue

Resolves #673

Solution and steps

  • Add File class
  • Use File class and return mime type, encoding and original file name in @ ValidateMultipartFormDataBody.
  • Disk(s): add readSize.

How to upgrade (to include in v2 release)

If you use @ValidateMultipartFormDataBody with buffers, update your code as follows:

// Before
const buffer = ctx.request.body.files.foobar;

// After
const { buffer } = ctx.request.body.files.foobar;

If you extend the abstract class AbstractDisk (i.e. you implement your own Disk), you must add a readSize method which returns the size of the file.

Checklist

  • Add/update/check docs (code comments and docs/ folder).
  • Add/update/check tests.
  • Update/check the cli generators.

@codecov-commenter
Copy link

codecov-commenter commented May 28, 2020

Codecov Report

Merging #730 into v2-0-0 will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           v2-0-0     #730   +/-   ##
=======================================
  Coverage   99.58%   99.58%           
=======================================
  Files          94       94           
  Lines        1706     1706           
  Branches      380      380           
=======================================
  Hits         1699     1699           
  Misses          7        7           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 27279c1...d0c2313. Read the comment docs.

@LoicPoullain LoicPoullain merged commit ba2185a into v2-0-0 May 29, 2020
@LoicPoullain LoicPoullain deleted the files-metadata branch May 29, 2020 07:26
@LoicPoullain LoicPoullain mentioned this pull request May 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants