<?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());
}