CiviCRM exports displayed in browser – no download / header missing

CiviCRM Asked by nielo on December 2, 2020

We’re facing an issue with contact exports. They become displayed in the browsers as raw text.

We recently updated to php 7.1 and CiviCRM 5.25.0 but unfortunately and due to infrequent use of the export functionality we can’t say if any of these changes directly led to the problem.

Does anybody has the slightest idea what could be causing this?

Update 2020-11-03

I’m stuck with this til today. I tried literally any detection method.

And exporting reports works.

When stracing apache for setting the header while exporting contacts or participants:

strace -fyp $(pgrep apache2|sed ':a;N;$!ba;s/n/,/g') -s 30000 |& grep -i 'Content-Disposition:'

I get no results.

It would be too nice if anybody may shed some more light on this.


Thx in advance

2 Answers

After upgrading to 5.30 the error seems to be gone.

Correct answer by nielo on December 2, 2020

If you have something like a file with a blank line at the top that might get output before the export data and cause the output to be interpreted as http content-type text instead of a download.

Check civicrm.settings.php or extensions or files in the CMS that might have changed.

You could also try running this from the root folder of your CMS:

find . -type f -exec awk 'NR==1&&/^$/{print FILENAME}' {} ;

or maybe this if the line isn't completely blank, like a couple tabs:

find . -type f -exec awk 'NR==1&&/^s*$/{print FILENAME}' {} ;

Answered by Demerit on December 2, 2020

Add your own answers!

Related Questions

Anonymous role cannot make contribution

1  Asked on December 20, 2020 by sts99


How can I assign one contact to one of the team workers?

2  Asked on December 10, 2020 by vanessa-davila


How to link two Organizations with a pair relationship?

1  Asked on August 30, 2020 by guillaume-sorel


Ask a Question

Get help from others!

© 2022 All rights reserved. Sites we Love: PCI Database, MenuIva, UKBizDB, Menu Kuliner, Sharing RPP, SolveDir