get("/attachment/{$attachment_id}", [ 'stream' => true, 'sink' => \Safe\fopen('php://stdout', 'wb') ]); $response->withHeader('Content-Type', 'application/pdf'); $response->getBody()->write($rs->getBody()->getContents()); return $response; } }