Hi, I want upload a file to server, so I get file path and file sended very good(I get responseCode: 200). but in backend (php), $_FILES is empty! how it possible?
note : when I send a form data and try again for upload this file it worked! Is something like cache?
code :
let options: FileUploadOptions = {
fileKey: 'files',
fileName: fileName.substr(fileName.lastIndexOf('/') + 1),
mimeType: 'multipart/form-data',
chunkedMode: false,
params: obj,
headers: this.headers
};
this.fileTransfer.upload(fileName, encodeURI(link), options)
.then((data) => {
this.messageCtrlService.showAlert(JSON.stringify(data), 'Success');
return data.response;
}, (err) => {
this.messageCtrlService.showAlert(JSON.stringify(err), 'Error');
})