xwikisas / application-googleapps

Google Apps Integration
0 stars 4 forks source link

Picking the "original" option when trying to import a file from Goog… #71

Closed trrenty closed 1 year ago

trrenty commented 1 year ago

…le Apps is showing an error #66

The Google Drive API seems to handle downloading files in two different ways, depending on the file type. For OFFICE documents, one should export them into a specified format, while for other kind of files, they can be downloaded directly.

Our code seemed to use the same method for all kind of files (the exporting way). This caused two problems. 1.When trying to download the original version of an office file, there was an error because we didn't specify any conversion format. 2.The second problem was that we tried to download other kind of files (other than office) with the same method we were doing the exports. When trying to do this, a "Bad Request" was returned.

To solve these issues, I used a different download method depending on whether we received exportFormats from backend or not, for each file returned.