Unable to send authorization token in fileupload call

UI Components for Angular
Post Reply
Ajit Singh
Posts: 2
Joined: 03 Oct 2019, 11:09

04 Oct 2019, 07:42

Hi Team,

I am using primeng p-fileupload to upload files . I need to send Authorization token to validate the call at server side. i tried to add token in onBeforeUpload, but it's not working.
below is the code that i tried.

BeforeUpload(event) {
event.formData.append('noteId', this.noteId);
event.xhr.setRequestHeader("Authorization", "Bearer " + sessionStorage.getItem("AccessToken"));

I'm able to get noteId ,but it's not working in case of authorization token.
Can you please help me regarding this.

Ajit Singh

Post Reply

Return to “PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 3 guests