// Function to convert Google Drive shareable link to a direct link
const convertGoogleDriveLink = (url) => {
// Regular expression to extract file ID from the Google Drive shareable URL
const regex = //d/([a-zA-Z0-9_-]+)/?/;
const matches = url.match(regex);
if (matches && matches[1]) {
return `https://drive.google.com/uc?id=${matches[1]}`;
}
// Return original URL if no match is found
return url;
};
I have already allowed anyone with the link to edit and view the folder and photo.
I can open the link itself to see the photo.
But it just cannot display on my website
New contributor
user26480421 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.