Helaers commented on issue #426:
URL: 
https://github.com/apache/cordova-plugin-file/issues/426#issuecomment-1549545767

   Came to this. issue repeatedly when searching for a way to fix opening files 
on Android that broke since skd 29.
   Updated my utillto make it work for devices running Android 11 with sdk 33.
   
   ```ts
   export async function openFile(remoteUrl: string, fileName: string, 
mimeType: string) {
     if (!isCordova(window)) {
       window.open(remoteUrl, '_blank');
       return;
     }
   
     const transfer = FileTransfer.create();
     const extension = mime.extension(mimeType);
     const devicePath = `${File.dataDirectory}${fileName}.${extension}`;
   
     await transfer.download(remoteUrl, devicePath);
     const fileEntry = await File.resolveLocalFilesystemUrl(devicePath);
     await FileOpener.open(fileEntry.nativeURL, mimeType);
   }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to