Feat: Add popup window to display teamer info per application
This commit is contained in:
@@ -5,7 +5,9 @@ namespace App\Controller\Common;
|
||||
use App\Entity\Upload;
|
||||
use App\Service\Upload\UploadHandler;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpFoundation\ResponseHeaderBag;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Component\Security\Http\Attribute\IsGranted;
|
||||
|
||||
@@ -17,11 +19,13 @@ class DownloadController extends AbstractController
|
||||
|
||||
#[Route('/download/{uuid}', name: 'app_common_download')]
|
||||
#[IsGranted('DOWNLOAD', subject: 'upload')]
|
||||
public function index(Upload $upload): Response
|
||||
public function index(Upload $upload, Request $request): Response
|
||||
{
|
||||
$path = $this->uploadHandler->getUploadFilepath($upload);
|
||||
$originalFilename = $upload->getOriginalFilename();
|
||||
$inline = (bool) $request->get('inline');
|
||||
$disposition = $inline ? ResponseHeaderBag::DISPOSITION_INLINE : ResponseHeaderBag::DISPOSITION_ATTACHMENT;
|
||||
|
||||
return $this->file($path, $originalFilename);
|
||||
return $this->file($path, $originalFilename, $disposition);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user