首页 > 解决方案 > 即使我有 Laravel 返回文件也找不到

问题描述

我使用 laravel 进行开发,在此之前一切正常,但本周,laravel 总是返回,file not found即使我有它在存储中。为什么会这样? 来自 laravel 的错误我的文件位置

public function file()
    {
        $file= asset('storage/documents/President New Year Message 2019 (Text only).pdf');

        $headers = [
            'Content-Type' => 'application/pdf',
        ];

        return response()->download($file, 'President New Year Message 2019 (Text only).pdf', $headers);
    }

标签: laravelstorage

解决方案


推荐阅读