mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-16 22:43:00 +00:00
Handle file upload in spawner form
Allow files to be uploaded in the spawner form.
This commit is contained in:
@@ -87,6 +87,8 @@ class SpawnHandler(BaseHandler):
|
||||
form_options = {}
|
||||
for key, byte_list in self.request.body_arguments.items():
|
||||
form_options[key] = [ bs.decode('utf8') for bs in byte_list ]
|
||||
for key, byte_list in self.request.files.items():
|
||||
form_options["%s_file"%key] = byte_list
|
||||
options = user.spawner.options_from_form(form_options)
|
||||
yield self.spawn_single_user(user, options=options)
|
||||
self.set_login_cookie(user)
|
||||
|
Reference in New Issue
Block a user