Reputation:
I have created two selects and want to send their values as parameters to the backend during upload. Do you know how to do that? Can you help me please?
My Code:
// Select Forms
// Month form
this.sendMonthsForm = this.fb.group({
monthsValue: [null]
});
// Year form
this.sendYearsForm = this.fb.group({
yearsValue: [null]
});
// Upload
this.uploader = new FileUploader({
url: `${environment.baseUrl}/upload?title=SuSa&context=${year}&period=${month}`,
maxFileSize: 2 * 1024 * 1024,
allowedFileType: ['csv', 'xls', 'xlsx'],
authToken: `Bearer ${currentUser.auth_token}`,
});
Upvotes: 0
Views: 1705
Reputation: 1
this.uploader = new FileUploader({
url: `${environment.baseUrl}/upload?title=SuSa&context=${year}&period=${month}`,
maxFileSize: 2 * 1024 * 1024,
additionalParameter:{uploaderparams1:'its-value',uploaderparams2:'its-value'},
allowedFileType: ['csv', 'xls', 'xlsx'],
authToken: `Bearer ${currentUser.auth_token}`,
});
Upvotes: 0
Reputation: 410
uploader: FileUploader = new FileUploader({
url: URL,
headers: [{ name: 'Authorization', value: 'Bearer ejy...' }]
});
Upvotes: 0