I want to upload file using aflresco restApi
this is my function
const formData = new FormData();
formData.append('filedata',file);
const newheaders = new HttpHeaders().set('Authorization', 'Basic '+token);
console.log("this is token before Uploading"+token);
const req = new HttpRequest('POST', uri, formData, {
headers: newheaders,
reportProgress: true,
responseType: 'json'
});
return this.http.request(req);
the token before uploading is valid ; it's tested with postman