Problem with download from files

We have since months problems with download from files from our webspace:

When choosing “save link as” on a file from our download page, Kirby is creating a folder in the media folder, copying the file to this folder and then downloading from this new location.
This works with no problem with very small files.

With larger files and Kirby 3.3.5 the Kirby created copy of the file was smaller as the original one (original 240MB / Copy 65-70MB). I copied with FileZilla the original file to the Kirby created folder and the problem was “solved”.

With Kirby 3.4.5 also no problem with very small files, but for larger files (4k KB is already “large”) Kirby is not even creating his own folder and making a copy of the file. Had deleted the whole content of the media folder, but this made no difference.

You can try this on https://www.hpl.at/download

The file HPLFastClient.exe will not work, the other four files have no problems. Tried this with the latest Chrome and Edge.

The server is not our own. PHP is version 7.3.19 as you can see with https://www.hpl.at/phpinfo.php

Question 1: Why is Kirby making copies in the media folder and not downloading the original file?

Question 2: Have you any ideas who to solve this problem!

Thanks for helping!

The copy in the media folder is created when the file url is called, i.e. when the page with the file is rendered, not when you download the file.

If you want to keep the files in the content folder, you can do so.

Read more about it here: Image URLs - How to remove string?

And welcome to the Kirby forum :wave:

Amazing! Kirby is not only a fast CMS, also the support is very fast!
Thanks, of the explanation why Kirby is making a copy in the media folder.
But why works this for my download page and four files, but not with the fifth one?

Probably because it is an executable file.

It’s probably a good idea to wrap that file in a zip-

You are right: it is working with zip files but not with exe files!

But there must be a bug in Kirby now: We are using Kirby since May 2019 and started with Kirby 3.1.3 The download of .exe files worked fine with Kirby 3.1.3 and 3.2.5.
The problem started with 3.3.5 and now 3.4.5.
Any ideas?

If no restrictions are defined in the file blueprint, Kirby will now limit the accepted uploads to the types image, document, archive, audio and video by default. This protects your sites against unexpected uploads like code files that could be used to attack the server or the visitor’s browsers.

According to that PR, you can override these default settings, not tested.

But this PR relates to Kirby 3.5-

Can you upload these files via the Panel?

Bingo, that’s it!
Via the panel I can upload a zip file, but not an exe file. When trying to upload an exe I receive the message (in German): Error – Prohibited filetype „exe“.

Seems, that we have to wait for 3.5 to offer again a download of exe files.
Where must this accept options then be put into?

Thanks a lot for this very fast helping!

Kirby 3.5 was released last Tuesday!

The accept options go into the file blueprint used for the files section/field.

I know, that 3.5.0 is released. That’s why I have installed 3.4.5. I don’t feel very comfortable with a .0 version in a production environment. At the moment we can live with the download of zip instead of exe files.

Sorry, I have no idea about web development: In which file we must put the new accept option?

As I said above, it goes into the file blueprint that you use for the section or field. This file blueprint is assigned to a files section or field via the [template option](Files section | Kirby CMS).

That means you haven’t set up the site? Then maybe contact the developer who did?