0

Here is my code to start upload multiple files using ngx-uploader:

startUpload(): void {
  let token = this.myToken;  // <----  get token
  const event: UploadInput = {
    type: 'uploadAll',
    url: 'http://ngx-uploader.com/upload',
    method: 'POST',
    headers: { 'Authorization': 'JWT ' + token },  // <----  set headers
    data: { 
        conversation_id: this.conversation.id,
        message_id: this.message_id }
  };

  this.uploadInput.emit(event);
}

In the first request, data.message_id is null and server will generate a new id.
After that I will get the new id in the response and update to data.message_id. But there is no way to update message_id for the next request.

dangquang1020
  • 496
  • 3
  • 7
  • 23

0 Answers0