0
  [Route("bulk_download")]
    public IHttpActionResult GetDownloadFilesAsync(string Ids)
    {
        try
        {
            var file_path = "c:/file_path/file.zip"; //I have a function which saves file to temp folder and returns the path 
            var file_data = FileHelper.ReadFile(file_path);
            bool is_deleted = FileHelper.DeleteFile(file_path);
            if (!is_deleted)
            {
                SlackClient.PostMessage("ERROR : couldn't delete file : " + file_path);
            }
            HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.OK);
            response.Content = new ByteArrayContent(file_data);
            response.Content.Headers.ContentType = new MediaTypeHeaderValue("application/octet-stream");
            response.Content.Headers.ContentDisposition = new ContentDispositionHeaderValue("attachment");
            response.Content.Headers.ContentDisposition.FileName = "download.zip";
            return ResponseMessage(response);
        }
        catch (Exception ex)
        {
            return InternalServerError();
        }
    }

I have a requirement where I need to send back 2 GB zip file.

Error Text : overflow or underflow in the arithmetic operation

Note : It is working fine for 1 GB of data.

http://prntscr.com/lp3dm1

0 Answers0