Pick the any file from device and upload to remote server

Please any one can help me for pick any file from device and after that need to upload in remote server. I have some code but using this code i get file picker windows and i can pick the file after that i cannot do anything, Please help for that.

1 Like

@gamiparesh

You can use cordova camera plugin to pick any file from the phone.

You need to do just on thing

set following option with in captureimage function. and it will allow you to select any file from phone.

var options = {
            quality: 50,
            destinationType: Camera.DestinationType.FILE_URI,
            sourceType: SourceType,
            encodingType: Camera.EncodingType.JPEG,
            mediaType :Camera.MediaType.ALLMEDIA,
            saveToPhotoAlbum: true

        }; 

and for sending file to remote server you can use cordova file transfer plugin.

How to pic and upload any file from device and upload to remote server in ionic 2??
plz help

1 Like