} private HttpResponseMessage DOWNLOAD_FILE(HttpWebResponse response)
Return File(().Result, 'application/octet-stream','filedownload.pdf') HttpResponseMessage result = DOWNLOAD_FILE(response) Response=(HttpWebResponse)request.GetResponse() String getlisturl = ' HttpWebRequest request = (HttpWebRequest)WebRequest.Create(getlisturl) Using (var httpClient = new HttpClient()) I am receiving a 'Damaged file ' Error while opening the file. I am unable to use HttpWebRequest object to download as a file in a controller action method.