Skip to main content

Upload files

Upload CSV, JSON, and other files to your Hex project.

info
  • Users will need Can Edit or higher permissions to upload files to the Notebook.

Upload files to your project

Upload CSV, JSON, and other file types to your Hex project from the Files sidebar. You can drag and drop files into the Drop files here area, or click browse files, select your files, and click Upload.

tip

If you want to allow viewers to upload CSVs to a published app, consider using a CSV upload input parameter.

Reference files in your project

You can reference uploaded files in Python cells.

You can also query a CSV file from a SQL cell using dataframe SQL.

To quickly query a CSV, locate the three-dot menu next to the file name in your Files sidebar, then click "Query in a new SQL cell".

Manage uploaded files

Each project is limited to 100 files, and each file must be less than 2GB in size. All uploaded files count towards your project upload limit, even if they aren’t referenced in your project.

tip

Delete any files that are no longer referenced in your project. This will free up project storage and optimize performance.

Every project has its own directory, /hex, where uploaded files are stored. Uploaded files are processed each time the project kernel starts, which can lead to longer kernel load times. We recommend deleting project files that are no longer in use.

caution

Any local files created in a subdirectory will not be persisted after the project's kernel has been restarted.

Delete files

You can delete an upload file from the Files sidebar in your project. Locate three-dot menu next to the file name, then click Delete.... You will be prompted to confirm before the file is deleted.

Programmatically delete all project files

To programmatically delete all local files in your project's directory, you can loop through the contents of your directory by running the below code snippet in a Python cell in your project.

caution

Deleted files are not recoverable. Be certain you want to delete all files from your project before using this code.

import os
for file in os.listdir():
if os.path.isfile(file):
os.remove(file)

Files in different run contexts

Local files written in Notebook sessions are persisted between runs of the project. Published apps and scheduled runs execute with different run contexts, and local files written during runs in these contexts will not be persisted.

If you want to save a file during a scheduled run or published app session, the data must be written to an external source, such as your database, or as external files.