Skip to content

Commit

Permalink
Update AdminController.php
Browse files Browse the repository at this point in the history
  • Loading branch information
summerblue committed May 12, 2020
1 parent 571da49 commit 63a6a26
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/controllers/AdminController.php
Expand Up @@ -440,16 +440,19 @@ public function displayFile()
{
//get the stored path of the original
$path = $this->request->input('path');
$data = File::get($path);
$file = new SFile($path);

$headers = array(
'Content-Type' => $file->getMimeType(),
'Content-Length' => $file->getSize(),
'Content-Disposition' => 'attachment; filename="'.$file->getFilename().'"',
);
if (File::exists($path)) {
$data = File::get($path);
$file = new SFile($path);

$headers = array(
'Content-Type' => $file->getMimeType(),
'Content-Length' => $file->getSize(),
'Content-Disposition' => 'attachment; filename="'.$file->getFilename().'"',
);

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

/**
Expand Down

0 comments on commit 63a6a26

Please sign in to comment.