Any way to share a image through Capacitor/Share without saving to the users device?

I’ve got an image saved in a db that I can retrieve as a blob (or really any type necessary if needed). the issue is I want the user to be able to send a text from there own phone number, with the message instead of a link to the image.
With Share I can use the “files”: field , but this requires a file:// path, otherwise I get an error, I do have a URI but share claims it isnt a file path.
any way to do this without saving the image to the phone?

Attached image gives me an error stating that share requires a file path:
image

Great question :slightly_smiling_face:, will get there soon :sweat_smile:

Have you tried with a data URL?

const url = 'data:image/jpeg;base64,' + base64encodedImage

Or did you find another solution in the mean time?

we found a bit of a workaround, we ended up writing the file to capacitors cache then sharing it with that file location, and that seems to have worked in a similar fashion.

I did attempt the data url and received the same error, regardless of how the data url was parsed.

1 Like