---
title: createFsFileStorage
source: https://github.com/remix-run/remix/blob/remix@3.0.0-beta.3/packages/file-storage/src/lib/backends/fs.ts#L29
---

# createFsFileStorage

## Summary

Creates a [`FileStorage`](/api/remix/file-storage/interface/FileStorage/) that is backed by a filesystem directory using `node:fs`.

Important: No attempt is made to avoid overwriting existing files, so the directory used should
be a new directory solely dedicated to this storage object.

Note: Keys have no correlation to file names on disk, so they may be any string including
characters that are not valid in file names. Additionally, individual `File` names have no
correlation to names of files on disk, so multiple files with the same name may be stored in the
same storage object.

## Signature

```ts
function createFsFileStorage(directory: string): FileStorage<LazyFile>;

```

## Parameters

### `directory`

The directory where files are stored

## Returns

A new [`FileStorage`](/api/remix/file-storage/interface/FileStorage/) backed by a filesystem directory