$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重定向到file:/company8\Production\2018\2018-12\Product1
发布于 2019-04-25 10:47:12
您可以使用return Redirect::away($url)
发布于 2019-04-25 11:14:29
尝试将反斜杠()改为斜杠(/)。
但是,由于安全原因,您无法重定向到文件协议。
当您重定向到它时
return Redirect::to("file://company8/Production/2018/2018-12/Product1");您将收到来自chrome的ERR_UNSAFE_REDIRECT。
return response()->file('/company8/Production/2018/2018-12/Product1');https://stackoverflow.com/questions/55841048
复制相似问题