Check out a question I posted some time ago about dealing with videos on the same topic: Uploading video to firebase (3.0) storage using cordovaFileTransfer
To handle this, you'll need to utilize cordova's file plugin to read as an arrayBuffer and then convert it into a blob. Here's an example:
var file_path = "root/to/directory";
var name = "filename.jpg";
$cordovaFile.readAsArrayBuffer(file_path, name)
.then(function (success) {
console.log(success);
var blob = new Blob([success], {type: "image/jpeg"});
console.log(blob);
var uploadTask = storageRef.child(name).put(blob);
uploadTask.on('state_changed', function(snapshot){
var progress = (snapshot.bytesTransferred / snapshot.totalBytes) * 100;
console.log('Upload is ' + progress + '% done');
}, function(error) {
console.log("Error uploading: " + error)
}, function() {
var downloadURL = uploadTask.snapshot.downloadURL;
console.log("Success!", downloadURL);
});
}, function (error) {
console.log("Failed to read file from directory, error.code);
}
If your program provides you with the full path to the image, remember to extract the file name by looking for everything after the final /