# How to Upload Files in Google Colab

The following code lets you upload one or more files from your computer directly into a Google Colab notebook:

```python
from google.colab import files
uploaded = files.upload()
```

## How it works

### 1\. Import the file-upload tool

```python
from google.colab import files
```

This imports Colab’s `files` module, which provides functions for uploading and downloading files in Google Colab.

### 2\. Open the upload window

```python
uploaded = files.upload()
```

When this line runs, Colab displays a **Choose Files** button. You can select one or more files from your computer.

The uploaded file(s) are stored in the `uploaded` variable as a dictionary.

*For example, if you select a PDF, Colab uploads it to the notebook environment and stores its information in the* `uploaded` *variable.*

### 3\. Check the filename(s)

```python
uploaded.keys()
```

## Complete Example

```python
from google.colab import files
uploaded = files.upload()
uploaded.keys()
```

---

## Open the notebook

Open the Google Colab notebook for this PDF mini-guide and run the code as you follow along.

\[[**Open in Google Colab**](https://colab.research.google.com/drive/1xf9r2mr0F3qWHJtl5jZXjBjWIKQK1HFh?usp=sharing)\]

---

This mini-guide was originally published on [PDF Python Hub](https://payhip.com/PDFPythonHub), where you can find more in-depth Python resources for working with PDFs.

---

## What's Next? Open Your First PDF in Google Colab

Want to learn how to open your first PDF in Google Colab?

Check out this mini-guide:

[Open Your First PDF with PyMuPDF](https://payhip.com/PDFPythonHub/blog/news/open-your-first-pdf-with-pymupdf)
