Download Context Menu

I am building a JLab 3.0 extension. The code snippet below downloads Python, txt, JPEG files as expected, but it downloads PNG, SVG, and other more uncommon files as “JSON”. Does anyone know how to fix this and why this happens?

When I say “as json” iI mean image.png gets downloaded as image.json

im using jupyter 3.0.0

what is the factory? what is the widget? Can you share a reproducible example?

The upstream filebrowser has a download method which works well with with images: jupyterlab/model.ts at 5c04fa6e8f8996608fa8d36be071d8d17a85a061 · jupyterlab/jupyterlab · GitHub