hello everyone,
recently it seems that chrome gives problems with binary format media asset links to download ( for example on clicking a cta present in the front end ). when you try to click on the link type cta with the download attribute, it no longer starts the download, but opens in a new page the file in binary format ( so with random character letters ).
this issue currently only occurs with chrome based browsers ( chrome, brave, edge, etc ) but not with safari or firefox.
Currently there would not seem to be a workaround that would work on all devices. This error would seem to stem from the fact that from data is not returned header āContent-Dispositionā.
Has anyone faced this type of problem before or know how to work around it?
Sorry about that! This is the second report weāve received, and we are still investigating the root cause⦠it only happens to some files for some users, not across the board.
A current workaround is to append ?dl=any-filename.ext to the URL to force a download. Like if your original filename was https://www.datocms-assets.com/12345/1234567890-example.pdf, using https://www.datocms-assets.com/12345/1234567890-example.pdf?dl=example.pdf will let Chromium browsers download it.
Our current hypothesis is that this may be due to files being uploaded by API without an explicit content-type header during the initial upload, but we are not sure about this. Can you please send me some URLs of files that are currently having this issue? (Feel free to PM me here if you donāt want to post them publicly).
Sorry about that! Weāll still investigating and hopefully with a few more examples, we can find the underlying issue.
hi roger, thank you very much for your quick reply!
the problem is related to binary files, in my case zipper files.
doing some research and testing i reconfirm you that it is related to the chromium engine and a possible solution, not always applicable, is header injection so that chromium interprets it as an attachment and not a āreadableā file
Tomorrow morning I will run a test through the real site, but as it is it would seem that this workaround works correctly
If you have a moment, could you please send us a few URLs of files exhibiting this behavior? It will help us track down what is causing it. Currently not all binary files or zip files are having this issue, only some of them, and weāre trying to find a pattern between them.