> For the complete documentation index, see [llms.txt](https://docs.flexbase.in/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flexbase.in/data-and-providers/data-stores/file-store.md).

# File Store

## Description

File stores register through `IFlexFileStore` (and optional `IFlexFileStoreWithUrls` / `IFlexFileStoreWithDirectories`). Your application code stays provider-agnostic while AWS S3, Azure Blob, and GCP Cloud Storage handle object storage.

## Configuration in DI

Register only the provider.

```csharp
// Pick ONE
services.AddFlexAwsS3FileStore(configuration);
// services.AddFlexAzureBlobFileStore(configuration);
// services.AddFlexGcpCloudStorageFileStore(configuration);
```

## appsettings.json

File store configuration is read from `FlexBase:DataStores:File:<Provider>`.

```json
{
  "FlexBase": {
    "DataStores": {
      "File": {
        "AwsS3": {
          "AccessKeyId": "<store-in-secrets>",
          "SecretAccessKey": "<store-in-secrets>",
          "Region": "us-east-1"
        }
      }
    }
  }
}
```

## Sample usage ({YourApplication})

```csharp
public class BackupUploader
{
	private readonly IFlexFileStore _fileStore;

	public BackupUploader(IFlexFileStore fileStore)
		=> _fileStore = fileStore;

	public Task UploadAsync(Stream payload, CancellationToken ct = default)
		=> _fileStore.WriteAsync(
			container: "backups",
			path: "daily/backup.zip",
			content: payload,
			contentType: "application/zip",
			ct: ct);
}
```

## Provider pages

* AWS S3: `file-store/aws-s3.md`
* Azure Blob: `file-store/azure-blob.md`
* GCP Cloud Storage: `file-store/gcp-cloud-storage.md`

## Provider considerations

* Treat `container` as bucket/container/root folder, and `path` as a forward-slash key.
* Keep credentials in secrets.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.flexbase.in/data-and-providers/data-stores/file-store.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
