# Upload Files

> Learn to upload files to Directus via both the data studio or API.

Multiple files can be uploaded simultaneously via both the data studio and via the API. File uploads are not limited to just images, they can be any kind of file.

<callout icon="i-lucide-info">

If you allow uploads from the public role or unauthenticated users, review [Restrict Public File Uploads](/guides/security/best-practices#restrict-public-file-uploads) first.

</callout>

## Data Studio

![The files module with a number of files visible in a gallery layout.](/img/796eb265-bce2-4faa-93d0-118dac406457.webp)

By opening the files module on the left, you will see your file library, which acts as one big folder to store all uploaded files and sub-folders.

Create a folder called `Images` and click on <icon name="material-symbols:add-circle-outline-rounded">



</icon>

.

![The popup that appears when clicking on the upload button.](/img/ec81bb5c-6dbf-4518-8684-0e5df99de013.webp)

You'll see a popup with options for uploading your file:

- Dragging a file from your desktop.
- Clicking on the popup area to select a file from your machine.
- Clicking on the menu in the popup and selecting "**Import from URL**"

Optionally, you can also click the file display to open the file details page and fill in information as desired.

## API

<code-group>

```http [REST]
// POST /files

Body must be formatted as a `multipart/form-data` with a final property called `file`.
```

```graphql [GraphQL]
# Not supported by GraphQL
```

```js [SDK]
import { createDirectus, rest, uploadFiles } from '@directus/sdk';

const directus = createDirectus('https://directus.example.com').with(rest());

const formData = new FormData();
formData.append('file_1_property', 'Value');
formData.append('file', raw_file);
formData.append('file_2_property', 'Value');
formData.append('file', raw_file_2);

const result = await directus.request(uploadFiles(formData));
```

</code-group>

The file contents has to be provided in a property called `file`. All other properties of
the file object can be provided as well, except `filename_disk` and `filename_download`.

<callout icon="i-lucide-info" color="info">

If `storage` is not specified, it defaults to the first location listed in [`STORAGE_LOCATIONS`](/configuration/files#storage-locations).

</callout>
