Page 1 of 1

Download PDF ERR_TOO_MANY_REDIRECTS

Posted: Sat Sep 02, 2017 11:48 pm
by PauloMussolini
Hi, team.
My site is Asp Net MVC 5 with AspNet Identity and my Stimulsoft is 2015.1.0.

In my localhost the download PDF file is working fine,
But in web (deployed) the PDF file Download not work (ERR_TOO_MANY_REDIRECTS). The viewer works.

The site is ssl (my localhost too)
The code:
public FileResult ExportReport()
{
var report = StiMvcViewerFx.GetReportObject(this.Request);
StiPdfExportService service = new StiPdfExportService();
StiPdfExportSettings settings = new StiPdfExportSettings();
settings.ImageQuality = 0.75f; // 0.95f;
settings.ImageResolution = 096.0f; // 300.0f;

MemoryStream stream = new MemoryStream();
service.ExportPdf(report, stream, settings);


return File(stream.ToArray(), "application/pdf", "Report.pdf");

}

I need help.

Thanks

Paulo Mussolini

Re: Download PDF ERR_TOO_MANY_REDIRECTS

Posted: Mon Sep 04, 2017 6:54 am
by Alex K.
Hello,

In this action, the viewer itself exports the report, and there is no need to export it yourself. Therefore, this error occurs.

Instead of the code:

Code: Select all

...
MemoryStream stream = new MemoryStream();
service.ExportPdf(report, stream, settings);
return File(stream.ToArray(), "application/pdf", "Report.pdf");
You can use:

Code: Select all

...
return StiMvcViewer.ExportReportResult(report, settings);
Thank you.