[IPython-dev] Best approach for uploading files through the Notebook?

Matthias BUSSONNIER bussonniermatthias@gmail....
Wed Jun 27 02:06:13 CDT 2012


> 
> But saving the file requires a server side handler.  We would have to
> make changes to both sides to do this.

If you want to upload on kernel CWD , couldn't you just use the widget <-> kernel API to send data to the kernel that write it to the disk, bypassing the server. 
something like 

%upload insert a function `foo_random_string` in current namespace and publish a JS upload widget.
upload widget have `foo_random_string` as callback to upload data.
once a file is uploaded `foo_random_string` send a signal to the widget, that changed to `file uploaded` and ask the kernel to del `foo_random_string`

The other things we might want to do is expose nb-uuidd/cwd/  as current **kernel** working directory.
-- 
Matthias



More information about the IPython-dev mailing list