This is my upload function
uploadresume()
{
this.fileChooser.open()
.then(uri =>
{
console.log(uri)
const fileTransfer: TransferObject = this.transfer.create();
let options1: FileUploadOptions = {
fileKey: 'file',
fileName: 'name.pdf',
params: {resume:uri},
chunkedMode : false,
headers: { Authorization:localStorage.getItem('token') }
}
console.log (localStorage.getItem('token'))
fileTransfer.upload(uri, "http://website.com/upload", options1)
.then((data) => {
// success
alert("success"+JSON.stringify(data));
}, (err) => {
// error
alert("error"+JSON.stringify(err));
});
})
.catch(e => console.log(e));
}
now my API endPoint takes in the parameter Resume with the file attached to it. But I keep getting 500 error. I am sure it’s something to do with the way I am sending the file to the endpoint. Can someone please assist me ?