USING GOOGLE DRIVE AS A CDN

How to extract the unique file identifier from Google Drive and format the URL correctly to make the image display without extra Google Drive wrappers.

1) Upload the file on Google Drive

2) Share file with Anyone with link

3) Copy the link: https://drive.google.com/file/d/1gH2x5CxnPNALXP9I3ANmDC0/view?usp=sharing

4) Copy the FILE_ID (red bit)

5) Use the following URL for your image: https://drive.google.com/uc?export=view&id=FILE_ID

https://lh3.googleusercontent.com/d/FILE_ID

Did you find this article useful?