-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Description
Is there an existing issue for this?
- I have searched the existing issues
Description
When using the built-in Google Drive datasource command Drive Get File By Id with Include File Contents = true, the returned file content is corrupted.
This is reproducible for binary files like PDFs. When the response is converted to Base64 and passed to DocumentViewer, nothing is rendered.
However, when I call the Google Drive API directly using a custom authenticated REST API:
GET https://www.googleapis.com/drive/v3/files/{fileId}?alt=media
and then convert that response to Base64, the file renders correctly.
So the same file works with a custom API but not with the built-in Google Drive datasource, which indicates that the datasource is corrupting or incorrectly encoding the binary response.
Expected behavior:
The Google Drive datasource should return the raw binary file correctly so it can be converted to Base64 and displayed in DocumentViewer.
Steps To Reproduce
- Create a Google Drive datasource in Appsmith.
- Add a query using command "Drive Get File By Id".
- Enter a valid PDF file ID.
- Enable "Include File Contents".
- Run the query.
- Convert the response to Base64 and bind it to a DocumentViewer widget.
- Observe that the PDF does not render.
Control test:
8. Create a REST API with Google OAuth and call:
GET https://www.googleapis.com/drive/v3/files/{fileId}?alt=media
9. Convert that response to Base64 and bind it to DocumentViewer.
10. The PDF renders correctly.
Public Sample App
No response
Environment
Production
Severity
Low (Cosmetic UI issues)
Issue video log
No response
Version
Cloud