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 metadata info while upload #673

Closed
sumanadak opened this issue Apr 8, 2020 · 4 comments
Closed

file metadata info while upload #673

sumanadak opened this issue Apr 8, 2020 · 4 comments

Comments

@sumanadak
Copy link

Could someone please help with this.
how do I get the original file name, file size, mime type while uploading a file?
I tried this
@ValidateMultipartFormDataBody({
files: {
photo: { required: true, saveTo: 'photos' }
}
})
uploadPhoto(ctx: Context) {
console.log(ctx.request.body)
const { path } = ctx.request.body.files.photo;
}
I only get the path here. Does it mean, I have send all other meta info through non-binary fields?

Help is much appreciated.

Thanks
Suman

@anonimusprogramus
Copy link
Contributor

Not an answer, just prettifying the code 😄

@ValidateMultipartFormDataBody({
  files: {
    photo: { required: true, saveTo: 'photos' }
  }
})

uploadPhoto(ctx: Context) {
  console.log(ctx.request.body)
  const { path } = ctx.request.body.files.photo;
}

@LoicPoullain LoicPoullain added this to Backlog in Issue tracking via automation Apr 17, 2020
@LoicPoullain
Copy link
Member

Thks @anonimusprogramus

It is currently not possible to access the original file name, file size, mime type at the moment. But this is something that will be probably added in the future.

Does it mean, I have send all other meta info through non-binary fields?

For the moment, yes.

@LoicPoullain LoicPoullain moved this from Backlog to To Do in Issue tracking Apr 17, 2020
@LoicPoullain LoicPoullain moved this from To Do to Work In Progress in Issue tracking May 23, 2020
@LoicPoullain
Copy link
Member

LoicPoullain commented May 29, 2020

Feature added in v2.0. It will be released between June and August.

Issue tracking automation moved this from Work In Progress to Done / Closed This Release May 29, 2020
@LoicPoullain LoicPoullain mentioned this issue May 29, 2020
@sumanadak
Copy link
Author

sumanadak commented May 31, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Issue tracking
  
Done / Closed This Release
Development

No branches or pull requests

3 participants