1.3.1 File Upload/Download
Colab offers you disk space for you to upload data and also to create new files. However, please note that these files will be deleted once your Colab session is closed!
There are several ways to upload/save data from your Colab session. Here are some options.
220.127.116.11 Option 1: Direct Colab Storage (Easiest)
You can upload files into directly into the drive of the ‘machine’ provided by Colab. Uploaded files will be stored in a folder named
You can view the content in the Colab machine by clicking
Table of Contents \(\rightarrow\)
These files will be deleted once your Colab session is closed!
18.104.22.168 Option 2: Use your Google Drive (Preferred)
A better option is to link your Google Drive to your Colab session. To use this option:
- Run the following code Python code at the start of the session.
from google.colab import drive '/content/drive')drive.mount(
- You will then be able to access your files through the path
There are many other ways of transferring files into and from Colab. Please see here for more details.