Working with Files#
Opening Files#
The file browser and File menu enable you to work with files and folders on your system. This includes opening, creating, deleting, renaming, downloading, copying, and sharing files and folders.
The file browser is in the left sidebar Files tab:
Many actions on files can also be carried out in the File menu:
To open any file, double-click on its name in the file browser:
You can also drag a file into the main work area to create a new tab:
Many files types have multiple viewers/editors. For example, you can open a Markdown file in a text editor or as rendered HTML. A JupyterLab extension can also add new viewers/editors for files. To open a file in a non-default viewer/editor, right-click on its name in the file browser and use the “Open With…” submenu to select the viewer/editor:
A single file can be open simultaneously in multiple viewer/editors and they will remain in sync:
Right-click on a file or folder and select “Copy Path” to copy the
filesystem relative path. This can be used for passing arguments to open
files in functions called in various kernels.
If you want to copy the filesystem absolute path, you must add the jupyterlab server config LabServerApp.copy_absolute_path=True and ServerApp.root_dir = 'xxx'.
Creating Files and Activities#
Create new files or activities by clicking the + button at the top
of the file browser. This will open a new Launcher tab in the main work area,
which enables you to pick an activity and kernel:
The current working folder of a new activity or document will be the folder listed in the file browser (except for a terminal, which always starts in the root directory of the file browser):
A new file is created with a default name. Rename a file by right-clicking on its name in the file browser and selecting “Rename” from the context menu:
Uploading and Downloading#
Files can be uploaded to the current folder of the file browser by dragging and dropping files onto the file browser, or by clicking the “Upload Files” button at the top of the file browser:
Any file in JupyterLab can be downloaded by right-clicking its name in the file browser and selecting “Download” from the context menu:
Disabling File Uploads#
You can disable file uploads in JupyterLab through multiple mechanisms:
Using the File Browser Settings
The file browser includes an “Allow file uploads” setting that can be configured in the Settings Editor (Settings → Settings Editor → File Browser), or by adding the following configuration to your settings (Settings → Advanced Settings Editor → File Browser):
{
"@jupyterlab/filebrowser-extension:browser": {
"allowFileUploads": false
}
}
When this setting is disabled, users will not be able to upload files either by clicking the “Upload Files” button or by dragging and dropping files into the file browser.
Removing the Upload Button via Settings
You can also remove the upload button entirely in the file browser toolbar by adding the following configuration to your settings (Settings → Advanced Settings Editor → File Browser):
{
"@jupyterlab/filebrowser-extension:widget": {
"toolbar": [
{
"name": "uploader",
"disabled": true
}
]
}
}
This will hide the “Upload” button from the file browser toolbar, but will not prevent drag-and-drop uploads unless the “Allow file uploads” setting is also disabled.
Combining Both Approaches
For complete UI-level upload restriction, it is recommended to:
Disable the “Allow file uploads” setting (
allowFileUploads: false) to prevent both button-based and drag-and-drop uploads in the file browser UIOptionally disable the upload button in the toolbar using the configuration above to remove the UI element entirely
Important
UI-Only Restriction
These settings only disable the file upload functionality in the JupyterLab user interface. They do not prevent file uploads at the server level. If the Jupyter server allows file uploads through its API, users can still upload files programmatically (e.g., using the Contents API directly, through custom code, or via other clients).
For true upload restriction, you must configure server-side permissions and access controls in addition to these UI settings. Consult the Jupyter Server documentation for information on server-side security configurations.