WIP: Implement profile editing

This commit is contained in:
Björn Fromme
2023-10-02 12:39:52 +02:00
parent d776d37cd5
commit 953aa9c8e0
27 changed files with 598 additions and 43 deletions
@@ -0,0 +1,27 @@
<?php
namespace App\Controller\Common;
use App\Entity\Upload;
use App\Service\Upload\UploadHandler;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Security\Http\Attribute\IsGranted;
class DownloadController extends AbstractController
{
public function __construct(private readonly UploadHandler $uploadHandler)
{
}
#[Route('/download/{uuid}', name: 'app_common_download')]
#[IsGranted('DOWNLOAD', subject: 'upload')]
public function index(Upload $upload): Response
{
$path = $this->uploadHandler->getUploadFilepath($upload);
$originalFilename = $upload->getOriginalFilename();
return $this->file($path, $originalFilename);
}
}