File Storage
Docs menu

Guides

Backends & cloud adapters

BYO storage always goes through your server. Use the HTTP or S3 proxy contract; optional helpers wrap the same HttpFileStore for Azure Blob and GCS.

Pick a backend

HTTP contract

Implement list / folder / upload / rename / move / remove / search on your origin and pass http: { baseUrl } to FileStorageSDK.mount. Full routes and the FileEntry shape are documented in the integration guide.

JavaScript
FileStorageSDK.mount({
  el: '#fm',
  apiKey: 'fs_live_…',
  http: {
    baseUrl: 'https://your-app.example/filestorage-proxy',
    headers: () => ({ Authorization: 'Bearer ' + token }),
  },
})

PHP / Laravel / Symfony

There is no separate PHP SDK binary. Load the CDN loader from your template, then proxy storage with a thin controller that speaks the HTTP contract (or the S3 proxy contract if you already use the AWS SDK).

resources/views/files.blade.php
<div id="fm" style="height: 70vh"></div>
<script src="https://cdn.filestorage.io/loader.min.js"></script>
<script>
  FileStorageSDK.mount({
    el: '#fm',
    apiKey: @json(config('services.filestorage.key')),
    http: {
      baseUrl: @json(url('/filestorage-proxy')),
      headers: () => ({ 'X-CSRF-TOKEN': @json(csrf_token()) }),
    },
  })
</script>

A minimal Laravel controller for the list route, using a Flysystem S3 disk:

app/Http/Controllers/FileStorageController.php
<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Storage;

class FileStorageController extends Controller
{
    public function list(Request $request)
    {
        $path = trim($request->input('path', '/'), '/');
        $disk = Storage::disk('s3');

        $folders = collect($disk->directories($path))->map(fn ($dir) => [
            'path' => '/' . $dir,
            'name' => basename($dir),
            'kind' => 'folder',
            'updatedAt' => now()->valueOf(),
        ]);

        $files = collect($disk->files($path))->map(fn ($file) => [
            'path' => '/' . $file,
            'name' => basename($file),
            'kind' => 'file',
            'size' => $disk->size($file),
            'updatedAt' => $disk->lastModified($file) * 1000,
            'url' => $disk->url($file),
        ]);

        return ['items' => $folders->concat($files)->values()];
    }
}

Azure Blob & Google Cloud Storage

Keep cloud credentials on the server. From the browser, use the helpers (aliases of HttpFileStore) and point them at a proxy that speaks the HTTP contract:

JavaScript
FileStorageSDK.mount({
  el: '#fm',
  apiKey: 'fs_live_…',
  store: FileStorageSDK.createAzureBlobStore({
    baseUrl: 'https://your-app.example/azure-proxy',
  }),
})

S3-compatible storage

Cloudflare R2, DigitalOcean Spaces, MinIO, and other S3-compatible services work through the reference S3 proxy - set a custom endpoint and keep using the s3 mount option.

examples/s3-proxy/.env
S3_ENDPOINT=https://<account-id>.r2.cloudflarestorage.com
S3_FORCE_PATH_STYLE=1        # required for MinIO
AWS_DEFAULT_REGION=auto
AWS_BUCKET=my-bucket
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
Cloudflare R2DigitalOcean SpacesMinIO

Drupal & Joomla