【发布时间】:2015-01-08 00:11:37
【问题描述】:
我正在使用 Laravel 将图像上传到我的文件夹。
$file = Input::file('largeImage');
$filePath = '/uploads/'.date("Y/m").'/'.time().'/';
$path = $filePath;
$file->move($path, $file->getClientOriginalName());
图片上传成功。
现在当我尝试访问它时:
http://localhost:8080/uploads/2015/01/1420644761/10377625_673554946025652_6686347512849117388_n.jpg
我遇到了Symfony \ Component \ HttpKernel \ Exception \ NotFoundHttpException 错误。
我什至试过http://localhost:8080/public/uploads/2015/01/1420644761/10377625_673554946025652_6686347512849117388_n.jpg
但同样的错误。可能是什么问题?我检查了上传文件夹,图像在那里。
【问题讨论】:
-
从错误来看,它看起来像是
Route::ing 问题,但奇怪的是您需要为这样的文件定义路由,所以我不确定。让我进一步研究一下。 -
我就是这么想的。