render($response, 'uploads.list'); } public function get(Request $request, Response $response, Client $client, $folder, $filename): Response { $resp = $client->get(implode('/', ['upload', $folder, $filename])); $file = $resp->getBody(); return $response ->withHeader('Content-Type', $resp->getHeader('Content-Type')) ->withHeader('Content-Disposition', 'attachment; filename=' . $filename) ->withAddedHeader('Cache-Control', 'no-store, no-cache, must-revalidate, max-age=0') ->withHeader('Cache-Control', 'post-check=0, pre-check=0') ->withHeader('Pragma', 'no-cache') ->withBody($file); } }