Commit 38936c52 by Aan Choesni Herlingga

bug fix download file

parent acc65b55
...@@ -43,15 +43,13 @@ class DownloadController extends Controller ...@@ -43,15 +43,13 @@ class DownloadController extends Controller
$fileModel = new File; $fileModel = new File;
$fileRepo = new FileRepository($fileModel); $fileRepo = new FileRepository($fileModel);
$dbfile = $fileRepo->findId($id); $dbfile = File::find($id);
if ($setting['external_storage'] == 1) { if ($setting['external_storage'] == 1) {
$file = $setting['url_static'] . '/' . $setting['directory'] . '/file/' . $dbfile->file; $file = $setting['url_static'] . '/' . $setting['directory'] . '/file/' . $dbfile->file;
} else { } else {
$file = url('/storage/file/' . $dbfile->file); $file = url('/storage/file/' . $dbfile->file);
} }
// dd($file);
$fileRepo->countDownload($dbfile); $fileRepo->countDownload($dbfile);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment