cordova-plugin-photo-library icon indicating copy to clipboard operation
cordova-plugin-photo-library copied to clipboard

saveImage() method not working when the image has params in the URL

Open davidvexel opened this issue 7 years ago • 4 comments

This function is not working then images have parameters in the URL like image.jpg?token=1234 which is actually the default format of Firebase images.

Not sure if this is bug, but just wanted to check in case there is a workaround for it.

davidvexel avatar Jan 11 '18 08:01 davidvexel

Have you tried adding a parameter like: "&ext=.jpg"

lwiml avatar Jan 11 '18 10:01 lwiml

Thank you @wimluiten, that works! This is my function in case somebody else has this same problem.

// Add .jpg param to force download
this.photoLibrary.saveImage(this.image + '&ext=.jpg', this.albumName).then((entry=>{
	console.log('download complete: ' + entry.photoURL);
	this.presentToast('download complete:' + entry.photoURL);
}),
(error) => {
	// handle error
	throw new Error(error);
});

davidvexel avatar Jan 11 '18 14:01 davidvexel

Good to hear, i couldn't even get the plugin to install ;)

I think this plugin is very useful for a lot of cordova (ionic) apps. We should keep it alive, but unfortunately i don't have a lot of time on my hands right now.

lwiml avatar Jan 11 '18 14:01 lwiml

You're right, this is a very helpful plugin it would be awesome if somebody can pick it up.

davidvexel avatar Jan 11 '18 14:01 davidvexel