Downloading CSS and HTML Customizations export fails

AI-generated summary

A bug was reported where downloading CSS and HTML customizations via the export feature fails with a “No File” error in Chrome, imrehg. The issue was reproduced by techAPJ and investigated. Bruges asked how to edit the exported JSON files, receiving clarification that they are plain text files readable by standard editors, as explained by jomaxro. techAPJ confirmed the root cause was Chrome missing the HTTP_ACCEPT header during the download request. The fix involved removing the download attribute from the anchor tag to ensure the header was included, which was verified to work across Chrome, Firefox, and Safari. The commit resolving this is available here: https://github.com/discourse/discourse/commit/dfd5b06c82ab30632ba6fdef224f8971eab0a44e.

I have some customization in a Discourse-hosted Discourse. When I hit export, I get a Failed - No File error in Chrome, with the file-name shown there as the customization’s ID.

If I then open the Chrome downloads page, and click on the failed link, it will download the file correctly. Here below the lower is the earlier file, shows failure, then I’ve clicked on clicked on that entry, and then the upper download happened with the correct filename and all.

I’m using Chromium 56.0.2924.87 on Linux 64-bit

「いいね!」 2

Can you repro @techapj?

「いいね!」 2

I can repro this issue. Added on my list.

「いいね!」 4

how can you open & edit .json file

@imrehg

@Bruges a json file is simply a fancy formatted text file. You can open it with your favorite text program, like Notepad, TextEdit, Notepad++, Sublime, Atom, etc.

「いいね!」 2

This issue was specific to Chrome/Chromium browser.

Chrome browser was not including HTTP_ACCEPT header when requesting file download. I fixed this issue by removing download attribute (from anchor tag) so now Chrome is making download request with HTTP_ACCEPT header included. Verified that download is working fine on Firefox and Safari as well.

https://github.com/discourse/discourse/commit/dfd5b06c82ab30632ba6fdef224f8971eab0a44e

「いいね!」 5