2022年11月5日 星期六

Google DriveToWeb jpg file blocked by CORS policy

Demo link

https://aframe-gallery.glitch.me/

Description information

https://aframe.io/docs/1.3.0/guides/building-a-360-image-gallery.html

1. Copy example into drivetoweb @ Google

2. Replace https://cdn.aframe.io/360-image-gallery-boilerplate/img/city.jpg by local jpg file

3. CORS error

Access to fetch at 'https://drive.google.com/uc?id=1axbPxNB1yL-tdZbKyt__jbjrFYSphzRm' (redirected from 'https://uezbafchzoobug0w05g98q.on.drv.tw/www.092012a.io/GT1.jpg') from origin 'https://uezbafchzoobug0w05g98q.on.drv.tw' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

4. Reduce the size of jpg file (from 4M to 122K).

5. OK