protected function getFileName(Response $response)
    {
        $headers = $response->getHeaders();
        $contentDisposition = isset($headers['Content-Disposition'][0]) ? $headers['Content-Disposition'][0] : null;

        if ($contentDisposition && preg_match('/filename="(.+)"/', $contentDisposition, $filename)) {
            return $filename[1];
        }

        return null;
    }