s
Showing
19 changed files
with
12 additions
and
1 deletions
| ... | @@ -117,4 +117,12 @@ class ApiController extends Controller | ... | @@ -117,4 +117,12 @@ class ApiController extends Controller |
| 117 | return Response::json($response, $statusCode); | 117 | return Response::json($response, $statusCode); |
| 118 | 118 | ||
| 119 | } | 119 | } |
| 120 | |||
| 121 | public function view(File $file) | ||
| 122 | { | ||
| 123 | $response = new BinaryFileResponse($file->getAbsolutePath()); | ||
| 124 | $response->headers->set('Content-Disposition', 'inline; filename="' . $file->real_filename . '"'); | ||
| 125 | return $response; | ||
| 126 | } | ||
| 127 | |||
| 120 | } | 128 | } | ... | ... |
| ... | @@ -28,7 +28,10 @@ Route::group(array('prefix' => 'api/v1'), function($json) | ... | @@ -28,7 +28,10 @@ Route::group(array('prefix' => 'api/v1'), function($json) |
| 28 | Route::resource('api', 'ApiController@getApi'); | 28 | Route::resource('api', 'ApiController@getApi'); |
| 29 | 29 | ||
| 30 | }); | 30 | }); |
| 31 | Route::get('files/{file}/preview', ['as' => 'file_preview', 'uses' => 'FilesController@preview']); | 31 | |
| 32 | Route::get('files/{file}', 'ApiController@view'); | ||
| 33 | |||
| 34 | //Route::get('files/{file}', ['as' => 'file_preview', 'uses' => 'FApiController@getApi']); | ||
| 32 | 35 | ||
| 33 | //Route::resource('js/interface.js', function () { | 36 | //Route::resource('js/interface.js', function () { |
| 34 | // return asset('js/interface.js'); | 37 | // return asset('js/interface.js'); | ... | ... |
storage/app/SISKINDS_test/SISKINDS_test_file.jpg
→
public/files/SISKINDS_test/SISKINDS_test_file.jpg
1.87 MB
storage/app/SISKINDS_test/SISKINDS_test_file.pdf
→
public/files/SISKINDS_test/SISKINDS_test_file.pdf
File moved
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
-
Please register or sign in to post a comment