I am working an app in the phonegap android in which i want to upload a file (image and pdf) to the server. What i want is when an user will click on the upload button an option dialog will open from where the user will select a file to be uploaded and then when user selects the image/pdf file the file will be uploaded. Image upload is working fine using below code:
var options = {
destinationType: Camera.DestinationType.FILE_URI,
sourceType: Camera.PictureSourceType.PHOTOLIBRARY,
quality : 50
};
$cordovaCamera.getPicture(options).then(function(file) {
//success
}, function(error) {
//error
});
Am using ngcordova camera plugin: http://ngcordova.com/docs/plugins/camera/
Can anyone tell me how to upload pdf using this plugin? If pdf upload is possible with any other plugin please share. Any help is appreciated.
Thanks in advance.