I have a problem with downloading files from Craft CMS using the "download asset" action on the asset page in the control panel.

These files don't have a public URL and needs to be downloaded this way.

If I check the SHA256 hash of the uploaded file in the asset's folder, it is correct. But when downloading it I get a different hash and in cases of .exe and .zip-files also corrupting and making them unable to run. The zip-files can't be unzipped.

Why does this happening?

1 Answer 1


Found the problem in index.php

The reason why this happened was that the index.php file had, by mistake, one space indentation. the download stream adds those extra spaces and making the files corrupt.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.