Laravel使用Redirect :: to()重定向到其他文件存储

时间:2019-04-25 02:39:45

标签: laravel redirect

$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

2 个答案:

答案 0 :(得分:0)

您可以使用<a class="V0MxL r-iouRA4dnjnsk" href="https://www.googleadservices.com/pagead/aclk?sa=L&amp;ai=DChcSEwjajYGGnerhAhVtANMKHS7gDKYYABAAGgJ3Yg&amp;ohost=www.google.com&amp;cid=CAESEeD2qv-1juqYmFBdcohZcFwG&amp;sig=AOD64_3EPN3EpYMWlKpKa-PyxGDbSTEInw&amp;q=&amp;ved=2ahUKEwjl6_mFnerhAhWy1eAKHacmB80Q0Qx6BAgLEAE&amp;adurl=" id="vn1s0p1c0" onmousedown="return google.arwt(this)" ontouchstart="return google.arwt(this)" data-preconnect-urls="https://www.expedia.com/" jsl="$t t-r1glFWqNI5A;$x 0;"><h3 class="sA5rQ">Expedia - Book Cheap Flights | Fly At Incredible Prices | expedia.com‎</h3><br><div class="ads-visurl"><span class="Z98Wse">Ad</span><cite class="UdQCqe">www.expedia.com/Flights/Book</cite>‎</div></a>

答案 1 :(得分:0)

尝试将反斜杠()更改为斜杠(/)。

但是,由于安全原因,您无法重定向到文件协议。

当您重定向到它

return Redirect::to("file://company8/Production/2018/2018-12/Product1");

您将从Chrome收到ERR_UNSAFE_REDIRECT

尝试通过以下方式回复

return response()->file('/company8/Production/2018/2018-12/Product1');