| Current Path : /home/users/unlimited/www/whatsapp-crm/app/Http/Controllers/ |
| Current File : /home/users/unlimited/www/whatsapp-crm/app/Http/Controllers/FileController.php |
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class FileController extends Controller
{
public function show($filename)
{
$path = storage_path('app/' . $filename);
if (!file_exists($path)) {
abort(404);
}
$file = \File::get($path);
$type = \File::mimeType($path);
$response = \Response::make($file, 200);
$response->header("Content-Type", $type);
return $response;
}
}