TransWikia.com

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.

/Update

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}' {} ;

https://askubuntu.com/a/1072314

Answered by Demerit on December 2, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP