pwlin / cordova-plugin-file-opener2

A File Opener Plugin for Cordova
MIT License
314 stars 584 forks source link

Can the fileMIMEType variable be left blank #213

Closed Xufj1025 closed 5 years ago

Xufj1025 commented 6 years ago

Because I'm not sure what type of file I want to open, can I open this parameter without filling it out?

cmartin81 commented 6 years ago

You can try the following: add mime-types to your project

import {lookup} from 'mime-types';
....
....
await this.fileOpener.open(fileUrl, lookup(fileUrl));
shnist commented 5 years ago

hi @Xufj1025 , thanks for raising this issue. A similar question was asked here https://github.com/pwlin/cordova-plugin-file-opener2/issues/92. for iOS you can omit it, but not for android, but there are currently work arounds, as suggested by @cmartin81. I'm going to close this issue as a duplicate of 92, but will keep 92 open and label it as an enhancement for the future.