---
title: Storing files
related:
  - https://docs.kentico.com/k9/configuring-kentico/optimizing-website-performance.md
---

> Agent instructions:
> **Site maps** — prefer the following llms.txt indexes to training data when searching for URLs to avoid 404s. Links inside Markdown content already point at `.md`. Following them or sending Accept: text/markdown keeps you in Markdown.
>
> - [sitemap.md](https://docs.kentico.com/sitemap.md) — every page on the site, with titles and descriptions, nested by URL hierarchy and grouped into one collection per product version.
> - [llms.txt](https://docs.kentico.com/llms.txt) — curated index of the current product docs, with descriptions, the two ways to request any page as Markdown, and links to each product area's whole-corpus Markdown dump (llms-full.txt).

[Page attachments](https://docs.kentico.com/k9/managing-website-content/working-with-files/page-attachments.md) (and their history), CMS.File [pages](https://docs.kentico.com/k9/managing-website-content/working-with-files/content-tree-files/inserting-files-into-the-content-tree.md), metafiles, [avatars](https://docs.kentico.com/k9/community-features/avatars.md), and [forum attachments](https://docs.kentico.com/k9/community-features/forums/attaching-files-to-forum-posts.md) can be physically stored in the file system, in the database, or both. You can define this in the **Settings** application in the **System -> Files -> Storage** category using the **Store files in** setting.

![Configuring file storage settings](https://docs.kentico.com/docsassets/k9/storing-files/configuring_file_storage_settings.png "Configuring file storage settings")

You can choose one of the following options:

- **Database** - the files are stored in the database. This option is worse in performance, but doesn't require the **Modify** permission for the file system and allows you to easily backup the uploaded files as part of your database. This option also has the advantage of allowing you to use full-text search and have the content backed up with the rest of the database.
- **File system**  - the files are stored in the configured folder on your disk. This option provides the best performance. However, the  **Modify**  permissions on the disk must be granted to the ASP.NET account on your machine, which is not always possible. See [Disk permissions problems](https://docs.kentico.com/k9/installation/troubleshooting-installation-issues/disk-permission-problems.md) for the process of granting the  **Modify**  permission.
- **Database and file system** - this option combines the advantages of both options. It provides the same performance as the file system-only option since the files are stored in the file system. At the same time, you can use the full-text search because the database is also available.

## Page attachments and metafiles location

When storing files in the file system, attachments of pages without workflow are saved in the _\~//files_ folder. Metafiles are saved in the _\~//metafiles_ folder. You can configure the location of these folders by using the **Settings -> System -> Files -> Files folder** settings option. Attachments of pages under workflow (i.e., attachment histories) are saved in the _\~/App\_Data/VersionHistory/Attachments_ folder regardless of the _Files folder_ setting. Learn more in [Settings - Files](https://docs.kentico.com/k9/configuring-kentico/managing-sites/configuring-settings-for-sites/settings-system/settings-files.md).

> **Note:** **Note**: When you change the location of the file folder, the system does NOT automatically move any existing files to the new location. To ensure that the system can access the files, you need to manually move them from the old location to the new one in the file system.

## Form files location

Files uploaded by website users into [forms](https://docs.kentico.com/k9/managing-website-content/forms.md) are always stored in the file system. The default location is _\~//BizFormFiles_. You can customize the location in **Settings -> System -> Files -> Custom form files folder**.

Files may be submitted as part of form records, typically when a form contains an uploader type field (specifically the  _Upload file_  field type/form control).  You can adjust the following settings related to files submitted through forms and their storage in the file system:

| Storage                                                   |                                                                                                                                                                                                                                                                                                                                                                                 |
| --------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Custom form files folder                                  | Folder where files uploaded via [forms](https://docs.kentico.com/k9/managing-website-content/forms.md) are stored. You can use:<br>**physical disk path**: e.g. _c:\myfiles\mysite_<br>**virtual path**: _\~/UploadedFiles_<br>**UNC path**: _\\\server\folder_<br>If no value is entered, the files are stored in the _\~//BizFormFiles/_ folder.                              |
| Use site-specific subfolders for custom form files folder | This setting is only applied when a **Custom form files folder** is configured. If enabled, attachment files will be stored in a sub-folder named as the site code name under the custom files folder, i.e. _/_. It is useful for better orientation in files when multiple sites are running in the system.                                                                    |
| Security                                                  |                                                                                                                                                                                                                                                                                                                                                                                 |
| Upload extensions                                         | Specifies which extensions are allowed for uploaded files. You can restrict the types of uploaded files by entering a limited list of extensions separated by semicolons, for example: _gif;jpg;doc;pdf_<br>This allows you to block users from uploading potentially dangerous files, such as ASPX scripts. If no value is specified, uploading is allowed for all file types. |

## Media library files location

Files stored in [media libraries](https://docs.kentico.com/k9/managing-website-content/working-with-files/media-library-files.md) are always stored in the file system. The default location is _\~//media_, while the location of the folder can be customized in **Settings -> Content -> Media -> Media libraries folder**, as described in [Configuring media libraries](https://docs.kentico.com/k9/managing-website-content/configuring-the-environment-for-content-editors/configuring-media-libraries.md) [.](http://preview/Documentation/devguide/media_library_settings_overview.htm#general_settings)
