Downloading files not working - instead it opens html

Hello everyone,

I have a weird issue.

First my snippet looks something like this:

 <a href="<?= $fileSingle->url() ?>">
   <?= $file->title()->html() ?>
 </a>

This is how the visitor see the page:

When the link is inspected (Like Berechnungstabelle Abgaben, Beiträge) it shows link too:

But when the link is clicked, the visitor is getting a html file and this:

Do you have a idea what I did wrong here?

Thanks in advance :slight_smile:

You might also be able to use download attribute on the link tag.

<a href="http://example.com/table.xlsx" download>Download File</a>
1 Like

This helped. Thanks!