How to select and upload file in ionic


#1

How to upload pdf file on server using $cordovaFileTransfer plugin. I have a below input field

<input type="file" onchange="angular.element(this).scope().fileNameChanged(this)">
How to get pathForFile here ?

$cordovaFileTransfer.upload(url, pathForFile, options).then(function(result) {
 alert('Your image has been successfully uploaded');
},
function(erro)
{
alert("Failed uploading image on server")
});