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

Wish: DOWNLOAD command #12

Closed
hostilefork opened this issue Feb 11, 2019 · 2 comments
Closed

Wish: DOWNLOAD command #12

hostilefork opened this issue Feb 11, 2019 · 2 comments
Labels
wish New feature or request

Comments

@hostilefork
Copy link
Owner

It would be nice that if you generate text or binary data that you could ask the REPL to generate a file for you and save it.

There are some instances of this being done for text:

https://stackoverflow.com/questions/3665115/create-a-file-in-memory-for-user-to-download-not-through-server

What would be nice would be if you could say something like:

>> download %my-download.zip zip [%file1.dat (data-var) %file2.txt (text-var)]

And have the browser give you a Save As... dialog where that binary could be saved.

If JavaScript is uncooperative for larger data or binary data, this could be done through a server that would proxy the request and give you a link to click on.

@hostilefork hostilefork added the wish New feature or request label Feb 11, 2019
@hostilefork
Copy link
Owner Author

This seems to be possible via the "Blob" API:

https://jsfiddle.net/koldev/cW7W5/

https://developer.mozilla.org/en-US/docs/Web/API/Blob

@hostilefork
Copy link
Owner Author

Wish fulfilled:

104e9e4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wish New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant