diff --git a/apps/files/lib/Controller/ViewController.php b/apps/files/lib/Controller/ViewController.php index a6f9f48673eda..9722e2aadb0f8 100644 --- a/apps/files/lib/Controller/ViewController.php +++ b/apps/files/lib/Controller/ViewController.php @@ -391,6 +391,8 @@ private function redirectToFile(int $fileId) { } else { // set parent path as dir $params['dir'] = $baseFolder->getRelativePath($node->getParent()->getPath()); + // open the file by default (opening the viewer) + $params['openfile'] = 'true'; } return new RedirectResponse($this->urlGenerator->linkToRoute('files.view.indexViewFileid', $params)); }