public virtual bool MoveRenameFile(jsreport.Client.Report report) { string[] fileNameArr = report.PermanentLink.Split('/'); string jsReportFileName = string.Empty; string jsReportFileExtension = string.Empty; if (fileNameArr.Length > 0) { jsReportFileName = fileNameArr[fileNameArr.Length - 2]; jsReportFileName += "." + report.FileExtension; jsReportFileExtension = report.FileExtension; } if (File.Exists(JsReportStoragePath + jsReportFileName)) { GenerateFileName(jsReportFileName, jsReportFileExtension); File.Move(JsReportStoragePath + jsReportFileName, GeneratedFilePath); return(true); } else { Error = "File not found"; return(false); } }
protected virtual void AddResponseHeaders(ActionExecutedContext context, EnableJsReportAttribute jsreportAttribute, Report output) { foreach (var httpResponseHeader in output.Response.Headers) { if (httpResponseHeader.Key.ToLower() == "connection" || httpResponseHeader.Key.ToLower() == "transfer-encoding") continue; context.HttpContext.Response.AddHeader(httpResponseHeader.Key, string.Join(";", httpResponseHeader.Value)); } foreach (var httpContentHeader in output.Response.Content.Headers) { if (jsreportAttribute.ContentDisposition != null && httpContentHeader.Key.ToLower() == "content-disposition") { context.HttpContext.Response.AddHeader(httpContentHeader.Key, jsreportAttribute.ContentDisposition); } else { context.HttpContext.Response.AddHeader(httpContentHeader.Key, string.Join(";", httpContentHeader.Value)); } } context.HttpContext.Response.ContentType = output.ContentType.MediaType; }