public void ProcessResult(IRequestContext request, IResponseContext response) { var fullPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, FilePath); if (!File.Exists(fullPath)) { throw new FileNotFoundException(String.Format("The file at {0} could not be found", fullPath)); } response.AddHeader("Content-Disposition", String.Format("attachment; filename={0}", Path.GetFileName(fullPath))); response.ContentType = getContentType(fullPath); response.WriteFile(fullPath); }