open_file icon indicating copy to clipboard operation
open_file copied to clipboard

is there any way to open .csv file?

Open avinashk369 opened this issue 4 years ago • 2 comments

this is the code. OpenFile.open("/storage/emulated/0/Android/data/com.xyz.abc/files/123.csv"); However i am able to open the same file from file explorer but getting alert message of corrupt csv file when i use the above code to open. i tried passing type and uti as well but nothing worked.

avinashk369 avatar Jul 17 '21 08:07 avinashk369

when calling OpenFile.open, whether to open it with the same third-party app as file explorer

crazecoder avatar Jul 19 '21 05:07 crazecoder

I'm assuming you're trying to open the CSV with the Google Sheets app.

Try to assign the "type" and "uti" like the following:

await OpenFile.open(
  value,
  type: 'text/csv',
  uti: 'public.comma-separated-values-text',
);

This did it for me at least. Try it out :)

benz93chung avatar Sep 13 '21 10:09 benz93chung