while trying to access an SVG file stored in Bubble’s database file manager through my plugin. The SVG is not being loaded correctly, and I am receiving a CORS-related error when attempting to fetch the file using its URL.
- I store an SVG file in Bubble’s database file manager.
- I try to access the SVG using its URL through my plugin.
- I attempt to load the SVG using
fetch()
or other methods. - The image does not load, and I receive the following CORS error:
- “Access to XMLHttpRequest at ‘https://your-bubble-app.bubbleapps.io/path-to-svgs/somefile.svg’ from origin ‘https://your-plugin-url’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.”
it is probably becuse when i am trying to fetch the file the img src in html is https://a62ce3520ef12afe21b787ab62ae3ec0.cdn.bubble.io/f1741231730610x195426502522422200/color.svg
and when open it from file manager it is https://a62ce3520ef12afe21b787ab62ae3ec0.cdn.bubble.io/f1741231730610x195426502522422200/color.svg?_gl=1*1rfstjs*_gcl_au*MjAxNDIzNzcxMy4xNzM1NTM1NDQz*_ga*MTcwODQ1ODMyNC4xNzM1MzAyNjE5*_ga_BFPVR2DEE2*MTc0MTIzMDM5NC40OS4xLjE3NDEyMzc2ODMuMTMuMC4w