laravel - Laravel 使用 Redirect::to() 重定向到其他文件存储
问题描述
$url = 'file:\\company8\Production\2018\2018-12\Product1';
return Redirect::to($url);
// 这会重定向到http://127.0.0.1:8000/file:/company8 \Production\2018\2018-12\Product1
// 如何让 laravel 重定向到文件:/company8\Production\2018\2018-12\Product1
解决方案
尝试将反斜杠()更改为斜杠(/)。
但是,由于安全原因,您无法重定向到文件协议。
当您重定向到它时
return Redirect::to("file://company8/Production/2018/2018-12/Product1");
您ERR_UNSAFE_REDIRECT
将从 chrome 收到。
尝试通过回应
return response()->file('/company8/Production/2018/2018-12/Product1');
推荐阅读
- apache-nifi - 在单个事务中将数据从 database1 复制到 database2 (Apache NiFi)
- javascript - 我应该在 PHP 中使用什么条件来检查我的 AJAX 请求中的 JSON 数据是否已成功接收?
- python - 在python中直接捕获变量
- python - 如何为熊猫中的多索引切片分配值
- docker - 使用 docker 和 ovs 进行测试配置中的大量数据包丢失
- wordpress - 如何创建“上传图像”到注册表?
- r - R用随机位置的预定义值填充向量
- git - 仅当远程分支已经存在时才推送到 git 分支
- macros - GNU 汇编器宏中的上下文本地标签。可能吗?
- python - 如何检查某些变量输入是否为特定类型