File upload from Ionic

I was wondering if it was possible to upload an image from an Ionic project, using cordova plugins to upload a file onto Backendless. The following function does not seem to be working:

Backendless.Files.upload( file, path, overwrite ) .then( function( fileURL ) { }) .catch( function( error ) { });

Hi Saurav,

Do you get an error in the “catch” block?

Regards,
Mark

I’m not able to figure out how to get the file path on the mobile phone in order to upload it.

So it is not a problem with the API call? Sounds like the API call has not even happened yet.

It hasn’t, but how to I retrieve the file path?

I am sorry, I do not know. Perhaps you could ask on the Ionic support forum?

To upload our file we use the FileTransfer plugin we initially installed. We have to create an object of different options which need to be passed to the transfer, you can experiment with them if you need different values or more information that needs to reach the server.