Prova per il download del file
This commit is contained in:
parent
fbb92e1e0c
commit
0e62b62c75
@ -35,5 +35,9 @@ class GenDocController extends Controller
|
||||
return redirect()->back();
|
||||
}
|
||||
|
||||
public function downloadFile($id){
|
||||
$doc = Gendoc::find($id)->get();
|
||||
return response()->download($doc->filename);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -51,7 +51,7 @@
|
||||
@foreach($documenti as $documento)
|
||||
<tr>
|
||||
|
||||
<td><a href="{{ asset('storage/'.$documento->filename) }}"><i class="fas fa-fw fa-file"></i> {{ $documento->descrizione }}</a></td>
|
||||
<td><a href="{{ route('download',['id'=>$documento->id]) }}"><i class="fas fa-fw fa-file"></i> {{ $documento->descrizione }}</a></td>
|
||||
|
||||
<td>
|
||||
<a class="btn btn-primary" href="/admin/doc_update?id={{ $documento->id }}">Edit</a>
|
||||
|
||||
@ -85,6 +85,7 @@ Route::middleware([
|
||||
// Route::post('admin/movimenti/docs', [DocumentiController::class,'storeFile']);
|
||||
Route::get('admin/movimenti/docs', [App\Http\Controllers\GenDocController::class,'fileForm'])->name('documenti');
|
||||
Route::post('admin/movimenti/docs', [App\Http\Controllers\GenDocController::class,'storeFile']);
|
||||
Route::get('admin/movimenti/download',[App\Http\Controllers\GenDocController::class,'downloadFile'])->name('download');
|
||||
// {issue #5}
|
||||
// Route::get('movimenti/docs', [DocumentiController::class,'fileMovimentiForm'])->name('documenti');
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user