"Insert into Notebook" fails with a csv.
When I attach a csv to a notebook and click "Insert into Notebook" I get this error: Error: unsupported file type: application/vnd.ms-excel. If I then use, "Copy Usage Code" with the same file, it works fine.
To Reproduce
- Attach file.
- Click "Insert into Notebook"
- See error.
Expected behavior The same behavior as "Copy Usage Code" without the copy and paste step.
Screenshots

Desktop (please complete the following information):
- OS: Windows 10
- Browser: Firefox
- Version 108.0.2
Could you please share the csv file? Or a redacted one?
Here is a notebook with a csv that had this issue: https://observablehq.com/d/513a07515763686a For reasons I don't understand, the file loaded as a database cell successfully (the error went away) as soon as I published the notebook to Public(unlisted). This still seems odd, and I think you will see the error if you download the csv and reattach to a clean notebook.
In any case, it is also an unexpected behavior, even if it worked correctly. It diverges from the behavior of "Copy usage code" and it's not clear to why a database cell would be the default here. Thanks for looking into this.
Best, Evan
@gallowayevan Can you confirm that the error disappears if you simply reload the notebook?
I suspect that what happens here is:
- when you upload the file, the MIME type gets reported by the browser
- on your system .csv extensions are registered as Excel files, resulting in this specific MIME type
- When you publish or reload the notebook, the file is fetched again with the MIME type now dictated by the Observable server
Edit: A quick way to test this is two create two cells:
viewof file = html`<input type="file">`
file.type
and then select a file.
Yes - a reload does the trick.