diff --git a/jupyter_server/services/contents/handlers.py b/jupyter_server/services/contents/handlers.py index 388e946cbf..1611a43ab9 100644 --- a/jupyter_server/services/contents/handlers.py +++ b/jupyter_server/services/contents/handlers.py @@ -254,6 +254,9 @@ async def put(self, path=""): raise web.HTTPError(400, f"Cannot create file or directory {path!r}") exists = await ensure_async(self.contents_manager.file_exists(path)) + if model.get("type", "") not in {None, "", "directory", "file", "notebook"}: + # fall back to file if unknown type + model["type"] = "file" if exists: await self._save(model, path) else: