Export works with filenames having spaces.

* The fix was to put the filename in double quotes in the
  Content-Disposition header.
* Export As/Clear All have been renamed to Export and Clr All
pull/37/head
Brian E. Granger 15 years ago
parent bf8ba0889e
commit c7a12effa1

@ -233,13 +233,13 @@ class NotebookHandler(web.RequestHandler):
last_mod, name, data = nbm.get_notebook(notebook_id, format)
if format == u'json':
self.set_header('Content-Type', 'application/json')
self.set_header('Content-Disposition','attachment; filename=%s.json' % name)
self.set_header('Content-Disposition','attachment; filename="%s.json"' % name)
elif format == u'xml':
self.set_header('Content-Type', 'application/xml')
self.set_header('Content-Disposition','attachment; filename=%s.ipynb' % name)
self.set_header('Content-Disposition','attachment; filename="%s.ipynb"' % name)
elif format == u'py':
self.set_header('Content-Type', 'application/x-python')
self.set_header('Content-Disposition','attachment; filename=%s.py' % name)
self.set_header('Content-Disposition','attachment; filename="%s.py"' % name)
self.set_header('Last-Modified', last_mod)
self.finish(data)

@ -68,7 +68,7 @@
</select>
</span>
<span class="section_row_buttons">
<button id="download_notebook">Export As</button>
<button id="download_notebook">Export</button>
</span>
</div>
</div>
@ -95,7 +95,7 @@
<span id="toggle_output" class="section_row_buttons">
<button id="collapse_cell">Collapse</button>
<button id="expand_cell">Expand</button>
<button id="clear_all_output">Clear All</button>
<button id="clear_all_output">Clr All</button>
</span>
<span class="button_label">Output</span>
</div>

Loading…
Cancel
Save