From 1feaee8eca2b107a2a8db6cbe2edf735becec5aa Mon Sep 17 00:00:00 2001 From: "Taylor Wilsdon (aider)" Date: Sun, 15 Dec 2024 20:29:12 -0500 Subject: [PATCH] feat: Update Google Drive download URL format for better compatibility --- src/lib/utils/google-drive-picker.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/utils/google-drive-picker.ts b/src/lib/utils/google-drive-picker.ts index 1646771e8..4b60f6b82 100644 --- a/src/lib/utils/google-drive-picker.ts +++ b/src/lib/utils/google-drive-picker.ts @@ -130,9 +130,9 @@ export const createPicker = () => { throw new Error('Required file details missing'); } - // Construct download URL without embedding token + // Construct download URL using usercontent format console.log('Constructing download URL for fileId:', fileId); - const downloadUrl = `https://www.googleapis.com/drive/v3/files/${fileId}?alt=media`; + const downloadUrl = `https://drive.usercontent.google.com/u/0/uc?id=${fileId}&export=download`; console.log('Download URL constructed:', downloadUrl); console.log('Current token value:', token ? 'Token exists' : 'No token');