When just download it again, then the excelfile is displayed correctly.
I first thought that that file has not been downloaded completely.
But it does not matter how long I wait. The file is very small anyway.
LibreOffice was trying to open the file via its text import assistent. It is meant for CSV files, not Excel files. Excel files are compressed, so it‘s expected that the file contents look like garbage when viewed as a text file.
Kirby itself can’t be the cause as the link behind the “Open” button points directly to the file in the media folder. On the first request this file gets copied by Kirby, but if this issue keeps occurring, it can’t be that.
Subsequent requests get handled directly by your web server (in this case most likely directly by nginx, but maybe by Apache and then forwarded by nginx).
What makes it even more weird is that you see the same behavior locally. So just to make sure we are on the same page: Does the issue occur on each “first” request after modifying or creating the Excel file with the plugin? Or did it also occur in such a subsequent request (when it has worked before without changes to the file but then doesn’t work again)?
Or did it also occur in such a subsequent request (when it has worked before without changes to the file but then doesn’t work again)?
No, it always occurs on the first download after the creation/update of the excelfile.
For every download after it always works.
I have tested it in combination with different browsers locally.
After creation/update of the File I downloaded it from Browser A > “error”
Then I did download it again on the same Browser and on Browser B > everthing ok
Then I did update the file and downloaded it on Browser B > “error”
Then downloading it on Browser A > everthing ok
Do you have any plugins installed? If so, please check all PHP files inside the plugins for extraneous empty lines. These most often occur at the start or end of the file before the <?php tag or after a ?> tag if defined.
Also check your config files inside site/config and models in site/models if you have any.