The report was short: images won’t download. It came with a screenshot of a small web app we use to browse generated assets — images, videos and a few audio files, 341 items in the catalog that day. When a download fails, the first suspect is usually the server: a missing file, a wrong path, an error status. So that is where the check started.

The server was fine

The image from the screenshot was easy to find, and both of its files answered with HTTP 200. The thumbnail was a JPEG, 600×450, 70,062 bytes. The original was a PNG, 1448×1086, 2,451,765 bytes. Both were fetched in a browser and decoded as images. Nothing was missing.

Then the save button in the detail panel was clicked in a real browser session, and we waited three seconds for a download event. None came. Reading the code explained why: that button had no click handler at all. It rendered, it looked like a button, and it did nothing. The save button on each grid card was only slightly different. Its handler stopped the click from also opening the card, and then stopped there. There was no download call behind it either.

Only one path actually downloaded anything: the button in the enlarged lightbox view. But that function fetched the item’s display URL, and in this catalog the display URL is the thumbnail; the original is stored in a separate field. So the one working path would have saved the 600×450 thumbnail in place of the 1448×1086 original. That part was found by reading the code, not by watching a save happen; the lightbox download was not tried before the fix.

What changed

The first pass was inspection only, and nothing was changed. When the fix was asked for, all three buttons were connected to one shared download function. It prefers the original over the thumbnail, keeps the original file name and extension, and refuses to save an HTTP error, an empty file, or an HTML or JSON page dressed up as an image. A second click on the same item while a download is in progress is ignored, and the page now says when a download is being prepared, has started, or has failed.

After the build, each of the three paths was clicked in a real browser: detail panel, lightbox and card. Each produced a download. All three files kept the original PNG name and were 2,451,765 bytes, and their SHA-256 matched a fresh, uncached copy of the original from the server, which decoded at 1448×1086. A simulated 404 showed the failure message instead of saving a broken file. Still not tested: videos, audio, assets from external sources or local folders. That was one image, through three buttons. Browser tabs that were already open need a reload to pick up the new build.

The bug report said “download,” and the server is where downloads come from, but the server had both files the whole time. When a button does nothing, check that it is wired to something before you check what is behind it.