{"id":"373ee28966500558","repo":"laravel/framework","slug":"this-driver-does-not-support-creating-temporary-up","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/FilesystemAdapter.php","lineNumber":908,"sourceCode":"     * @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 (method_exists($this->adapter, 'temporaryUploadUrl')) {\n            return $this->adapter->temporaryUploadUrl($path, $expiration, $options);\n        }\n\n        if ($this->temporaryUploadUrlCallback) {\n            return $this->temporaryUploadUrlCallback->bindTo($this, static::class)(\n                $path, $expiration, $options\n            );\n        }\n\n        throw new RuntimeException('This driver does not support creating temporary upload URLs.');\n    }\n\n    /**\n     * Concatenate a path to a URL.\n     *\n     * @param  string  $url\n     * @param  string  $path\n     * @return string\n     */\n    protected function concatPathToUrl($url, $path)\n    {\n        return rtrim($url, '/').'/'.ltrim($path, '/');\n    }\n\n    /**\n     * Replace the scheme, host and port of the given UriInterface with values from the given URL.\n     *\n     * @param  \\Psr\\Http\\Message\\UriInterface  $uri","sourceCodeStart":890,"sourceCodeEnd":926,"githubUrl":"https://github.com/laravel/framework/blob/bd6b5437e6ad87bb49f9b426724f07a9f64e9683/src/Illuminate/Filesystem/FilesystemAdapter.php#L890-L926","documentation":"Thrown by FilesystemAdapter::temporaryUploadUrl() when the adapter exposes no temporaryUploadUrl() method and no temporaryUploadUrlCallback was registered. Temporary upload URLs let clients push directly to cloud storage (e.g. S3 presigned PUT); they are not supported by local or generic adapters.","triggerScenarios":"Calling Storage::disk($name)->temporaryUploadUrl($path, $expiration) on a disk whose adapter lacks temporaryUploadUrl (local, ftp, sftp, custom) and where buildTemporaryUploadUrlsUsing() was not called.","commonSituations":"Implementing direct-to-S3 uploads but pointing at the local disk in dev; using a custom cloud adapter that didn't implement the method; forgetting to register the callback.","solutions":["Use an S3 disk for temporary upload URLs.","Register a builder: Storage::disk('custom')->buildTemporaryUploadUrlsUsing(fn($path,$exp,$opts) => [...]).","Guard with $disk->providesTemporaryUploadUrls() before calling.","In dev, route uploads through your own controller instead of presigned URLs."],"exampleFix":"// before - local disk has no presigned upload support\n[$url, $headers] = Storage::disk('local')->temporaryUploadUrl('uploads/x.txt', now()->addMinutes(5));\n\n// after\nif (Storage::disk('s3')->providesTemporaryUploadUrls()) {\n    [$url, $headers] = Storage::disk('s3')->temporaryUploadUrl('uploads/x.txt', now()->addMinutes(5));\n}","handlingStrategy":"validation","validationCode":"$disk = Storage::disk($name);\nif (! $disk->providesTemporaryUploadUrls()) {\n    abort(400, 'Direct uploads not supported for this disk');\n}\nreturn $disk->temporaryUploadUrl($path, $expiration);","typeGuard":"function diskSupportsTemporaryUploadUrls(\\Illuminate\\Filesystem\\FilesystemAdapter $disk): bool\n{\n    return $disk->providesTemporaryUploadUrls();\n}","tryCatchPattern":"try {\n    [$url, $headers] = Storage::disk($name)->temporaryUploadUrl($path, $expiration);\n} catch (\\RuntimeException $e) {\n    if (str_contains($e->getMessage(), 'temporary upload URLs')) {\n        abort(400, 'Direct upload not available; use the standard upload endpoint.');\n    }\n    throw $e;\n}","preventionTips":["Guard with providesTemporaryUploadUrls() before calling.","Use S3 for direct-to-storage uploads.","Register buildTemporaryUploadUrlsUsing() for custom adapters."],"tags":["filesystem","flysystem","temporary-upload-url","adapter","pre-signed"],"analyzedSha":"bd6b5437e6ad87bb49f9b426724f07a9f64e9683","analyzedAt":"2026-08-06T00:28:32.783Z","schemaVersion":2}