Chrome wants me to download my external dropbox links used in 2D GUI in the Playground

Dears,
I recently got some strange behavior when using an external (dropbox) link to display an image/icon in the 2D GUI controls, in the playground.

I didn’t check it in other browsers (sry), but it appears that CHROME (at least on mac) is now willing to download the link instead of just displaying it.

From this PG from the doc, for a simple imageOnlyButton, I replaced the link from the asset library with the only .svg icon provided (a full-screen.svg icon).

While opening the PG, everything’s fine. The icon shows and no attempt to download:

However, replacing the link with one of my links from my dropbox share… chrome wants me to download the image:

Any clues about that? Can you repro? Or am I just missing something obvious because I feel too hot :hot_face: (35°C :thermometer: at the moment :sunny: :sweat_smile:)?

It is strange, but there is no problem to create a texture from the same image link - https://playground.babylonjs.com/#XCPP9Y#22129

Do you mean you could repro? Did my PG also attempt to download the icon on your side?

Yes, this PG attempts to download SVG file - https://playground.babylonjs.com/#XCPP9Y#22128
The same link for texture works - https://playground.babylonjs.com/#XCPP9Y#22129

1 Like

Super interesting issue. There are two ways of reading the SVG, one (as @labris mentioned) is to use it as a texture - in this case we pass the image content to webgl and everything is done on that level. The other one, which is the way we are doing it when using it on the GUI is to create an HTML element and set the source to the svg. Then, on load, we use the rendered content. Now - since this is a download link from dropbox, they provide content-disposition on the response, which, in turn, forces the browser to download the file (with the filename provided). Interesting enough, it doesn’t happen when using webgl directly.

This is more of a dropbox feature than something we can solve. We can’t override the content-disposition (and there are probably very good reasons for that). On Dropbox-side, they allow certain types of accounts to provide a share link that is not a download link, but I am no dropbox expert, so I can’t really tell if tha will work - Solved: Can’t disable downloads on a shared link - The Dropbox Community (dropboxforum.com)

Very much relatable! Hang in there! For me it ends on Thursday. Hopefully the last heat wave of this summer :slight_smile:

2 Likes

Oh, really!? I thought it was new and this looks like an old topic. May be I never used an svg from dropbox in a playground GUI :face_with_hand_over_mouth: I would have thought I did :thinking: but yes, may be was just with the GUI Editor :thinking:

I will check this out. Thanks (both) and have a great day :sunglasses:

1 Like

Probably not entirely on you :slight_smile:

To render SVG correctly we now create a new SVG element and set the source to the string you provided. this is probably the reason for the download. But this way we get the svg corrrectly rendered

1 Like