Skip to content

Commit

Permalink
Merge pull request #3 from olefirenko/fork
Browse files Browse the repository at this point in the history
Fix file display
  • Loading branch information
olefirenko authored Jul 17, 2017
2 parents 0b7cb98 + ff8092b commit 6b47703
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/controllers/AdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -433,13 +433,10 @@ public function displayFile()
//get the stored path of the original
$path = $this->request->input('path');
$data = Storage::get($path);
$file = new SFile($path);

$headers = array(
'Content-Type' => $file->getMimeType(),
'Content-Length' => $file->getSize(),
'Content-Disposition' => 'attachment; filename="' . $file->getFilename() . '"'
);
$headers = [
'Content-Length' => Storage::size($path),
];

return response()->make($data, 200, $headers);
}
Expand Down

0 comments on commit 6b47703

Please sign in to comment.