Open felix-appsmith opened 1 year ago
I reproduced a similar behavior when uploading a file via FilePicker using the Dropbox API. The file gets uploaded successfully, but when opening it or downloading it from Dropbox, it is corrupted. The API works fine with Postman and uploads the file correctly. With Appsmith, it uploads the file but it gets corrupted. The only difference between Appsmith and Postman is the Body type (see screenshots). However, the API body I used in Appsmith should be correct according to this tutorial. Furthermore, if the file is in txt format, it does not get corrupted, but for psd, png, pdf files, the behavior is reproducible. A link to a sample app and more details are in this Slack thread.
@ame-appsmith did you try with the multi-part option?
@Nikhil-Nandagopal yes, I tried and got the same issue.
Is there an existing issue for this?
Description
I tried to do it using the V2 and V3 versions of the official Google Drive API. The authentication with OAuth2.0 is done correctly, and I can upload text files. However, when I upload images, they are uploaded apparently corrupted, since they do not show a preview of the file and when downloading they can be opened either.
When I tried the same configuration in Postman, everything went well. I could obtain the auth token to make the request and the file was uploaded successfully.
I also tried uploading the file to Dropbox and despite the response being successful (status 200), nothing was uploading to the destination folder.
Steps To Reproduce
Drop a filepicker widget and edit its properties to store binary or Base64 data.
Configure an Authenticated API datasource with your credentials. The URL to upload files is
https://www.googleapis.com/upload/drive/v3/files
.Add a new POST query. Configure
uploadType = media
in the Params,Content-type = {{FilePicker1.files[0].type}}
in the Headers and{{FilePicker1.files[0].data}}
in the Body of the request (you can also try{{FilePicker1.files[0]}}
).Run the query, go to Google Drive and notice the corrupted file.
Public Sample App
No response
Environment
Production
Issue video log
No response
Version
Cloud Appsmith v1.9.32-SNAPSHOT