Reading Excel Data From PlutoUI File Picker

I’m using a PlutoUI filepicker and for a CSV file I can read the data for CSV with CSV.File but I’m stumped at how to do this for a .xlsx file. Everything for reading .xlsx files seems to want a path but the the filepicker only returns the file name, not the full path so nothing finds the file.

I see the data there but I just can’t figure out how to read it. Any suggestions?

The problem of the FilePicker is that it can’t provide the full file path due to restrictions set by the web browser.
One possible solution would be to write the data into a temporary file and read that one by XLSX.
Another way is to provide the full file path as a String. This can also be extended to multiple files using readdir and PlutoUI.Select.

I am not sure if it is possible to get a virtual file path to avoid the duplication of data.

1 Like

Is there a default location for assets to house a temp file? Haven’t done this before. I don’t mind writing a temp I just don’t know where to write out so it is accessible and I’m not right back at the starting point.

The are functions to create temporary files or folders called tempname and mktemp.

For a long term solution maybe a PR to enable the use of an IOBuffer or UInt8 array for XLSX would be the best

Thank you so much for your help. I ended up getting this to work:

image

First time using tempname. Glad to know of the functionality.