Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Web-share api level 2 PDF support

I am using web-share level 2 for my PWA app. Every media format is working fine except PDF. Web api is returning base64 string of PDF, At client side, I am creating blob object from it. but when I share it, Throws exception : Permission Denied

 var file = new File(["/9j/4AAQSkZJRgABAQAAAQABAAD...."], 'filename.pdf', { type: 'application/pdf' });

var filesArray = [];

filesArray.push(file);

 navigator['share']({files: filesArray})
        .then(() => console.log('Share was successful.'))
        .catch((error) => console.log('Sharing failed', error));

I don't have any clue whats going on.

like image 609
Ashish Gehlot Avatar asked Nov 24 '25 10:11

Ashish Gehlot


1 Answers

For others who might encounter this problem, this was discussed on https://github.com/w3c/web-share/issues/141 and is a current limitation in Chrome tracked in https://crbug.com/1006055

like image 180
dontcallmedom Avatar answered Nov 27 '25 00:11

dontcallmedom



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!