Issue tracker to get file content with Drive.Files.get() to avoid the need of UrlFetchApp.fetch

Skip to first unread message

Alan Wells

Feb 8, 2020, 9:34:08 PM2/8/20
to Google Apps Script Community
The Advanced Drive Service has a

Drive.Files.get('File ID Here',{alt:'media'});

method to get files, and accepts the {alt:'media'} URL parameter to return the file content, but it results in an error.
The status response code is actually 200, and gets the file content, but the error halts the code.

There is an alternative way to get file content with UrlFetchApp.fetch() but making an external request requires authorization that would be nice to avoid.  The reason that you want to avoid using UrlFetchApp.fetch() to make an external request is that it requires users to authorize a permission that could keep you from getting your project approved by Google for public use.

Please click the star in the issue tracker if you want to follow and/or support this issue.

Reply all
Reply to author
0 new messages