php - Laravel Queue 使用 CURL 下载文件
问题描述
我正在尝试使用 curl 生成文件。当我尝试通过终端执行命令时,它工作正常。
但是当我尝试使用队列在 laravel 上实现它时,脚本运行但下载的文件已损坏。
正如您从“花费的时间”中看到的那样,与从终端执行的相比,它甚至没有价值。该文件在那里,但显然已损坏,因为 laravel 甚至在它开始之前就已经完成了命令。
这是我关于handle()
GeneratBukuVot Job 功能的代码:
$path = Storage::path('public/test.pdf');
$pentaho = 'http://192.168.0.17:8080/pentaho/api/repos/:home:admin:anggaran_hasil_and_belanja_param.prpt/generatedContent?output-target=pageable/pdf&search_year=2019';
$cmd = 'curl -u"admin:password" "'.$pentaho.'" -o "'.$path.'"';
$output = shell_exec($cmd);
我正在使用 Laravel 5.8 版。请帮忙。
解决方案
推荐阅读
- python - Visual Studio 代码的 Coverage-Gutter 扩展未显示 python3 项目中的行覆盖率
- jquery - jQuery 不工作!我不明白问题是什么
- unix - 将文件名重命名为 filename_inode (Unix)
- html - Angular 的 StencilJS 性能问题
- node.js - IBM - 使用 API 和 Node.js 创建 VPC
- xcode - 无法在 10.15 下调试系统首选项窗格
- ruby-on-rails - 为什么当我呈现页面时,我的 simple_form_for 集合代码中不显示下拉列表项?
- azure-devops - 将父字段添加到任务板中的工作项卡
- subscription - 如何在下一个续订日期更新定期订阅价格?
- android - SDK 中的 Android 服务问题 >= 26