for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the BenGorFile package.
*
* (c) Beñat Espiña <[email protected]>
* (c) Gorka Laucirica <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace BenGorFile\FileBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\BinaryFileResponse;
/**
* File download controller.
* @author Beñat Espiña <[email protected]>
class DownloadController extends Controller
{
* Gets the file of given file name in the Gaufrette filesystem.
* @param string $filename The file name
* @param string $uploadDestination The gaufrette filesystem
* @return BinaryFileResponse
public function gaufretteAction($filename, $uploadDestination)
return new BinaryFileResponse('gaufrette://' . $uploadDestination . '/' . $filename);
}
* Gets the file of given file name in the Symfony filesystem.
* @param string $uploadDestination The path of file storage
public function symfonyAction($filename, $uploadDestination)
return new BinaryFileResponse($uploadDestination . '/' . $filename);