Tengo un backend php que me da datos img binarios. Utiliza file_get_contents('myImageUrl') y devuelve el resultado a mi front-end usando axios . El resultado de file_get_contents se ve así:
Lo que quiero es usar esto para compartir la imagen a través de la opción javascript navigator.share() . llegué hasta aquí:
let url = this.$store.dispatch("api/myendpoint"); Promise.all([ url ]) .then((data) => { const filesArray = new File([data[0]], "filename.png", {type: data[0].type}) navigator.share({ text: 'See this image', files: filesArray, }) }) .catch((error) => { console.log(error) });Pero en la consola me sale el siguiente error:
Uncaught (in promise) TypeError: Failed to execute 'share' on 'Navigator': Failed to read the 'files' property from 'ShareData': The object must have a callable @@iterator property.