{"id":"6d9d8680e77a84bb","repo":"laravel/framework","slug":"this-driver-does-not-support-creating-temporary-up-6d9d86","errorCode":null,"errorMessage":"This driver does not support creating temporary upload URLs.","messagePattern":"This driver does not support creating temporary upload URLs\\.","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"src/Illuminate/Filesystem/LocalFilesystemAdapter.php","lineNumber":109,"sourceCode":"     * Get a temporary upload URL for the file at the given path.\n     *\n     * @param  string  $path\n     * @param  \\DateTimeInterface  $expiration\n     * @param  array  $options\n     * @return array\n     *\n     * @throws \\RuntimeException\n     */\n    public function temporaryUploadUrl($path, $expiration, array $options = [])\n    {\n        if ($this->temporaryUploadUrlCallback) {\n            return $this->temporaryUploadUrlCallback->bindTo($this, static::class)(\n                $path, $expiration, $options\n            );\n        }\n\n        if (! $this->providesTemporaryUploadUrls()) {\n            throw new RuntimeException('This driver does not support creating temporary upload URLs.');\n        }\n\n        $url = call_user_func($this->urlGeneratorResolver);\n\n        return [\n            'url' => $url->to($url->temporarySignedRoute(\n                'storage.'.$this->disk.'.upload',\n                $expiration,\n                ['path' => strtr(rawurlencode($path), ['%2F' => '/']), 'upload' => true],\n                absolute: false\n            )),\n            'headers' => [],\n        ];\n    }\n\n    /**\n     * Specify the name of the disk the adapter is managing.\n     *","sourceCodeStart":91,"sourceCodeEnd":127,"githubUrl":"https://github.com/laravel/framework/blob/bd6b5437e6ad87bb49f9b426724f07a9f64e9683/src/Illuminate/Filesystem/LocalFilesystemAdapter.php#L91-L127","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Use an S3-compatible disk where temporaryUploadUrl() is supported natively for environments that need direct uploads.","Guard with providesTemporaryUploadUrls(): if (Storage::disk($disk)->providesTemporaryUploadUrls()) {...}.","Register a custom builder via Storage::disk('local')->buildTemporaryUrlsUsing(...) that returns a signed route pointing to your own upload-handling controller.","Replace direct-upload logic with a standard multipart form upload POSTed to your server when running on a local disk."],"exampleFix":"// before\n$upload = Storage::disk('local')->temporaryUploadUrl('uploads/'.$file, now()->addMinutes(5));\n\n// after\n$disk = Storage::disk('local');\n\nif ($disk->providesTemporaryUploadUrls()) {\n    $upload = $disk->temporaryUploadUrl('uploads/'.$file, now()->addMinutes(5));\n} else {\n    // Fallback: regular server-side upload endpoint\n    $upload = ['url' => route('uploads.store'), 'headers' => []];\n}","handlingStrategy":"validation","validationCode":"use Illuminate\\Support\\Facades\\Storage;\n\n$disk = Storage::disk('local');\nif (! $disk->providesTemporaryUploadUrls()) {\n    // do not call temporaryUploadUrl(); use a regular server-side upload endpoint\n    abort(501, 'Temporary upload URLs are not supported on this disk.');\n}","typeGuard":"function supportsTemporaryUploadUrls(string $diskName): bool {\n    return Storage::disk($diskName)->providesTemporaryUploadUrls();\n}","tryCatchPattern":"try {\n    $upload = Storage::disk($disk)->temporaryUploadUrl($path, $expiration);\n} catch (\\RuntimeException $e) {\n    if (str_contains($e->getMessage(), 'does not support creating temporary upload URLs')) {\n        $upload = ['url' => route('uploads.store'), 'headers' => []];\n    } else {\n        throw $e;\n    }\n}","preventionTips":["Use providesTemporaryUploadUrls() before invoking temporaryUploadUrl().","Keep direct-to-storage upload code on S3-compatible disks only.","Provide a server-side upload fallback for environments without presigned-upload support."],"tags":["filesystem","storage","local","temporary-upload-url","runtime-exception"],"analyzedSha":"bd6b5437e6ad87bb49f9b426724f07a9f64e9683","analyzedAt":"2026-08-06T00:28:32.783Z","schemaVersion":2}