Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70435

Ioniv v4 csv file transfer to a server

$
0
0

@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

Read full topic


Viewing all articles
Browse latest Browse all 70435

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>