//todo: not using 'Using' on file stream because: https://stackoverflow.com/questions/9541351/returning-binary-file-from-controller-in-asp-net-web-api public HttpResponseMessage DownloadAsync(Guid fileId) { try { HttpResponseMessage response = new HttpResponseMessage(); Tuple <string, string> credentials = HelperMethods.NamePasswordFromAuthHeader(Request.Headers.Authorization.Parameter); string userName = credentials.Item1; CFile file = _fileContext.GetByFileId(fileId); FileStream fs = new FileStream( file.Path + file.Name, FileMode.Open, FileAccess.Read, FileShare.Read, chunkSize, true); response.Content = new StreamContent(fs); response.Content.Headers.ContentType = new MediaTypeHeaderValue("application/octet-stream"); return(response); } catch (Exception ex) { throw ex; } }