return response ()->download ($pathToFile); 调用这个函数没反应?

代码

    /**
     * 导出excel
     */
    public function exportExl()
    {
        $result = Excel::download(new InvoicesExport, 'invoices.xlsx');
        $absPath = $result->getFile()->getPathname();
//        $path = $result->getFile()->getPath();
//        $fileName = $result->getFile()->getFilename();
//        $testPath = public_path('images/fa9e99dce6a114bc77e929f9ed94a959.jpg');
        $info = response()->download($absPath, 'info.xlsx');
    }

$absPath 是绝对路径。

@李山河
你看我吊吗啊
《L04 微信小程序从零到发布》
从小程序个人账户申请开始,带你一步步进行开发一个微信小程序,直到提交微信控制台上线发布。
《L03 构架 API 服务器》
你将学到如 RESTFul 设计风格、PostMan 的使用、OAuth 流程,JWT 概念及使用 和 API 开发相关的进阶知识。
你看我吊吗啊
最佳答案
5年前 评论
讨论数量: 3
你看我吊吗啊

...有反应 ,下载了,其实。 只不过覆盖了原来的文件而且没有重命名。。。

5年前 评论
你看我吊吗啊
5年前 评论

发的什么玩意地址

3年前 评论

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!