【发布时间】:2016-10-31 13:00:08
【问题描述】:
我正在将我的文件放入存储中,它正在工作。但是,下载链接返回错误。
这是允许用户上传文件的视图
<div class="form-group{{ $errors->has('notes') ? ' has-error' : '' }}">
<label class="col-md-4 control-label">Upload your notes</label>
<div class="col-md-6">
<input type="file" class="form-control" name="notes">
@if ($errors->has('notes'))
<span class="help-block">
<strong>{{ $errors->first('notes') }}</strong>
</span>
@endif
</div>
</div>
这是我在控制器中对请求的处理。
Storage::put(
'notes/' . $note->id . '.pdf',
file_get_contents($request->file('notes')->getRealPath())
);
所有触发和 pdf 文件都存储在我的 storage/app/notes 目录中。
我用来下载文件的链接是:/notes/90.pdf,其中“90”是笔记 ID。
我遇到了错误
RouteCollection.php 第 161 行中的 NotFoundHttpException:
【问题讨论】: