0

Trying to open a file from ionic react code, but couldn't do it as it throws an error with fileOpener.open is not recognized or undefined.

import { FileOpener } from '@awesome-cordova-plugins/file-opener/ngx';
const callFileOpen = () => {
    fileOpener.open("file:///C:/Users/seedapps.shankar/Downloads/sample.xlsx",'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet')
       .then(() => console.log('File is opened'))
       .catch(e => console.log('Error opening file', e));
  }

0 Answers0