laravel/framework · error · RuntimeException

This driver does not support creating temporary upload URLs.

Error message

This driver does not support creating temporary upload URLs.

What it means

Sibling of the temporary-URL error, thrown by LocalFilesystemAdapter::temporaryUploadUrl() when neither a temporaryUploadUrlCallback is set nor signed-URL serving with a URL generator is enabled. Temporary upload URLs are typically used for direct-to-storage browser uploads (presigned POST/PUT). The local filesystem driver has no native equivalent, so it refuses instead of producing an unusable URL.

Source

Thrown at src/Illuminate/Filesystem/LocalFilesystemAdapter.php:109

     * Get a temporary upload URL for the file at the given path.
     *
     * @param  string  $path
     * @param  \DateTimeInterface  $expiration
     * @param  array  $options
     * @return array
     *
     * @throws \RuntimeException
     */
    public function temporaryUploadUrl($path, $expiration, array $options = [])
    {
        if ($this->temporaryUploadUrlCallback) {
            return $this->temporaryUploadUrlCallback->bindTo($this, static::class)(
                $path, $expiration, $options
            );
        }

        if (! $this->providesTemporaryUploadUrls()) {
            throw new RuntimeException('This driver does not support creating temporary upload URLs.');
        }

        $url = call_user_func($this->urlGeneratorResolver);

        return [
            'url' => $url->to($url->temporarySignedRoute(
                'storage.'.$this->disk.'.upload',
                $expiration,
                ['path' => strtr(rawurlencode($path), ['%2F' => '/']), 'upload' => true],
                absolute: false
            )),
            'headers' => [],
        ];
    }

    /**
     * Specify the name of the disk the adapter is managing.
     *

View on GitHub (pinned to bd6b5437e6)

Solutions

  1. Use an S3-compatible disk where temporaryUploadUrl() is supported natively for environments that need direct uploads.
  2. Guard with providesTemporaryUploadUrls(): if (Storage::disk($disk)->providesTemporaryUploadUrls()) {...}.
  3. Register a custom builder via Storage::disk('local')->buildTemporaryUrlsUsing(...) that returns a signed route pointing to your own upload-handling controller.
  4. Replace direct-upload logic with a standard multipart form upload POSTed to your server when running on a local disk.

Example fix

// before
$upload = Storage::disk('local')->temporaryUploadUrl('uploads/'.$file, now()->addMinutes(5));

// after
$disk = Storage::disk('local');

if ($disk->providesTemporaryUploadUrls()) {
    $upload = $disk->temporaryUploadUrl('uploads/'.$file, now()->addMinutes(5));
} else {
    // Fallback: regular server-side upload endpoint
    $upload = ['url' => route('uploads.store'), 'headers' => []];
}
Defensive patterns

Strategy: validation

Validate before calling

use Illuminate\Support\Facades\Storage;

$disk = Storage::disk('local');
if (! $disk->providesTemporaryUploadUrls()) {
    // do not call temporaryUploadUrl(); use a regular server-side upload endpoint
    abort(501, 'Temporary upload URLs are not supported on this disk.');
}

Type guard

function supportsTemporaryUploadUrls(string $diskName): bool {
    return Storage::disk($diskName)->providesTemporaryUploadUrls();
}

Try / catch

try {
    $upload = Storage::disk($disk)->temporaryUploadUrl($path, $expiration);
} catch (\RuntimeException $e) {
    if (str_contains($e->getMessage(), 'does not support creating temporary upload URLs')) {
        $upload = ['url' => route('uploads.store'), 'headers' => []];
    } else {
        throw $e;
    }
}

Prevention

When it happens

Trigger: Calling Storage::disk('local')->temporaryUploadUrl($path, $expiration) on a local disk without a registered builder. Triggered by upload packages (e.g., filepond/livewire direct uploads) that call temporaryUploadUrl() for direct uploads, or custom code mirroring S3 presigned-PUT logic onto a local disk.

Common situations: Using S3-style direct browser uploads in production but a local disk in dev/test. Migrating from s3 to local for CI without adjusting the upload flow. Forgetting that the local driver needs buildTemporaryUrlsUsing()/a custom controller to support the upload variant.

Related errors


AI-assisted analysis of laravel/framework@bd6b5437e6 (2026-08-06). Data as JSON: /data/errors/6d9d8680e77a84bb.json. Report an issue: GitHub.