Created
March 29, 2019 08:38
-
-
Save Kcko/3cf72ad4c90f2942d4b4bb4d433eff99 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
# https://forum.nette.org/cs/31783-mazanie-suboru-po-samotnej-akcii-stiahnut-subor#p202279 | |
use Nette\Application\Responses\FileResponse; | |
use Nette\Http\IRequest; | |
use Nette\Http\IResponse; | |
final class DownloadAndDeleteFileResponse implements Nette\Application\IResponse | |
{ | |
private $response; | |
public function __construct(FileResponse $response) | |
{ | |
$this->response = $response; | |
} | |
public funcion send(IRequest $request, IResponse $response) | |
{ | |
$this->response->send($request, $response); | |
unlink($this->response->getFile()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment