---
title: "BeforeFileCreatedEvent"
manual: "TYPO3 Explained"
version: "14.3"
permalink: "https://docs.typo3.org/permalink/t3coreapi:beforefilecreatedevent@14.3"
source: "ApiOverview/Events/Events/Core/Resource/BeforeFileCreatedEvent.rst"
rendered: "2026-10-11T16:27:50+00:00"
---

# `BeforeFileCreatedEvent` {#beforefilecreatedevent}

The PSR-14 event `\TYPO3\CMS\Core\Resource\Event\BeforeFileCreatedEvent`
is fired before a file is about to be created within a resource
[storage](https://docs.typo3.org/permalink/t3coreapi:fal-architecture-components-storage@14.3) /
[driver](https://docs.typo3.org/permalink/t3coreapi:fal-architecture-components-drivers@14.3).
The folder represents the "target folder".

This allows to further analyze or modify the file or filename before it is
written by the driver.

## Example {#before-file-created-event-example}

> [!NOTE]
> Currently, we do not have an example for this event. If you can provide a
> useful one, please open [an issue](https://github.com/TYPO3-Documentation/TYPO3CMS-Reference-CoreApi/issues/new) with your code snippets or
> [a pull request](https://docs.typo3.org/m/typo3/docs-how-to-document/main/en-us/Howto/EditLocal.html#docs-contribute-git-docker).

## API {#before-file-created-event-api}

-   **class BeforeFileCreatedEvent**

    -   *Fully qualified name:* `\TYPO3\CMS\Core\Resource\Event\BeforeFileCreatedEvent`

    This event is fired before a file is about to be created within a Resource Storage / Driver.

    The folder represents the "target folder".

    This allows to further analyze or modify the file or filename before it is written by the driver.

    -   **getFileName()**

        *Returns:* `string`

    -   **getFolder()**

        *Returns:* `TYPO3CMSCoreResourceFolder`
