Image Sharing with special character in URL Fails

When i try to share image with %20 in URL it fails, how do i get rid of it? Cordova SocialSharing Plugin.

URL Example:

copy image to some another image by removing spacial character. Shaer this new Image and delete it after sharing completes

i have tried to share image by renaming image from yellowflat%20(1).jpg to yellowflat(1).jpg. It works

That means with space in image name it do not share image. what can i do now? i have 10000+ image like this format in names?

you may use string.replace(/[\s]/g, ‘’); to your file name before sharing