Skip to content

Commit

Permalink
Update to only use relative paths
Browse files Browse the repository at this point in the history
Signed-off-by: snipe <[email protected]>
  • Loading branch information
snipe committed Sep 7, 2023
1 parent 65a76c5 commit 894c34f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app/Http/Controllers/Users/UserFilesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace App\Http\Controllers\Users;

use App\Helpers\StorageHelper;
use App\Http\Controllers\Controller;
use App\Http\Requests\AssetFileRequest;
use App\Models\Actionlog;
Expand Down Expand Up @@ -143,17 +144,17 @@ public function show($userId = null, $fileId = null)
$this->authorize('view', $user);

$log = Actionlog::find($fileId);
$file = 'private_uploads/users/'.$log->filename;

// Display the file inline
if (request('inline') == 'true') {
$headers = [
'Content-Disposition' => 'inline',
];
return Storage::download($file, $log->filename, $headers);
return Storage::download('private_uploads/users/'.$log->filename, $log->filename, $headers);
}

return Response::download($file); //FIXME this doesn't use the new StorageHelper yet, but it's complicated...
return Storage::download('private_uploads/users/'.$log->filename);

}

// Redirect to the user management page if the user doesn't exist
Expand Down

0 comments on commit 894c34f

Please sign in to comment.