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

Files upload in one thread, props thered ignored? #421

Open
golubvladimir opened this issue Feb 11, 2022 · 0 comments
Open

Files upload in one thread, props thered ignored? #421

golubvladimir opened this issue Feb 11, 2022 · 0 comments

Comments

@golubvladimir
Copy link

I have component

    <file-upload
      class="page__file"
      post-action="http://localhost:3000/api/vacancies/upload"
      v-model="resume"
      ref="resume"
      :multiple="true"
      :maximum="2"
      :thread="2"
      :size="1024 * 1024 * 1024"
    >
      Загрузить резюме
    </file-upload>
    <button @click.prevent="uploadFiles">Upload</button>

    ...

    methods: {
      uploadFiles() {
        this.$refs.resume.active = true;
      }
    }

I select two files, after click button. But I have two call file upload handler on server.

  @Post('upload')
  @UseInterceptors(AnyFilesInterceptor())
  uploadFiles(
    @UploadedFiles() files: Array<Express.Multer.File>
  ) {
    console.log(files);
  }

Result:

[
  {
    fieldname: 'file',
    originalname: '456.txt',
    encoding: '7bit',
    mimetype: 'text/plain',
    buffer: <Buffer >,
    size: 0
  }
]
[
  {
    fieldname: 'file',
    originalname: '123.txt',
    encoding: '7bit',
    mimetype: 'text/plain',
    buffer: <Buffer 48 65 6c 6c 6f 20 57 6f 72 6c 64>,
    size: 11
  }
]
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

No branches or pull requests

1 participant