Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Binary dragged & dropped files should not be fetched as text by default #2456

Open
wlach opened this issue Nov 19, 2019 · 4 comments
Open

Binary dragged & dropped files should not be fetched as text by default #2456

wlach opened this issue Nov 19, 2019 · 4 comments

Comments

@wlach
Copy link
Contributor

wlach commented Nov 19, 2019

Steps to reproduce:

  • drag & drop a binary file into iodide main page (e.g. an excel file called Furniture_only.xls)

Expected:

%% fetch
blob: file0=Furniture_only.xls

Got:

%% fetch
text: file0=Furniture_only.xls

It is still a pain to do something with the excel file (#2447) but the fact that we're fetching the file as text is yet another roadblock. Perhaps we could sniff the type of the uploaded file and then set this property of the created notebook accordingly? @hamilton / @openjck any thoughts on this?

@wlach
Copy link
Contributor Author

wlach commented Nov 27, 2019

Did some spelunking and the code in question is here:

({ file }, i) => `text: file${i}=${file.name}`

The file object we're destructuring and mapping also has a type property in addition to a name (e.g. text/csv, image/png). A quick win here would be to use blob if the type property does not start with "text".

@wlach
Copy link
Contributor Author

wlach commented Nov 27, 2019

Working on this will require setting up the full server implementation (since the home page isn't visible with simple-serve) but should not otherwise be too difficult.

@ThobyV
Copy link

ThobyV commented Dec 17, 2019

Hi, I would love to work on this.

@iodide-project iodide-project deleted a comment from ThobyV Dec 17, 2019
@wlach
Copy link
Contributor Author

wlach commented Dec 17, 2019

Hi, I would love to work on this.

Great! Go ahead and submit a PR, be sure to follow the guidelines here:

https://iodide-project.github.io/docs/contributing/

Note that there are no current plans for Iodide to participate in next year's GSOC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants