@viewweb wrote:
Hi, I want to upload a CSV file to a server using the FileTransfer plugin using ionic v4. I am doing it but every time I have the following error
An error has occurred: Code = 1
I derive the csv file through
<input id=“file-upload-clienti” type=“file” accept=".csv" (change)=“fileUploadClienti($event)”>and in the fileUploadClienti($event) I am doing the following
let options: FileUploadOptions = {
fileKey: ‘file’,
fileName: ‘test.csv’,
chunkedMode: false,
mimeType: “text/csv”,
headers : {Connection: “close”},
}fileTransfer.upload(url, ‘http://xxx.xxx.xxx.xxx:8080/YYY/uploadNew.php’, options)
.then(
() => alert(“pippo”),
(e)=> {
alert("An error has occurred: Code = " + e.code);
alert(“errore source:”+e.source);
alert(“errore target:”+e.target);} );
What I am doing wrong?
Posts: 1
Participants: 1