You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to download .xls file from google drive. drive_service.list_files is working fine for me to get file_id but for download following code drive_service.export_file(file_id,'application/vnd.ms-excel',
download_dest: "/home/tt/Desktop/Automation/TestSheet.xls")
is giving error
/home/tt/.rvm/gems/ruby-2.0.0-p648/gems/google-api-client-0.13.0/lib/google/apis/core/http_command.rb:218:in check_status': Invalid request (Google::Apis::ClientError) from /home/tt/.rvm/gems/ruby-2.0.0-p648/gems/google-api-client-0.13.0/lib/google/apis/core/api_command.rb:116:in check_status'
from /home/tt/.rvm/gems/ruby-2.0.0-p648/gems/google-api-client-0.13.0/lib/google/apis/core/download.rb:103:in execute_once' from /home/tt/.rvm/gems/ruby-2.0.0-p648/gems/google-api-client-0.13.0/lib/google/apis/core/http_command.rb:104:in block (2 levels) in execute'
from /home/tt/.rvm/gems/ruby-2.0.0-p648/gems/retriable-3.0.1/lib/retriable.rb:50:in block in retriable' from /home/tt/.rvm/gems/ruby-2.0.0-p648/gems/retriable-3.0.1/lib/retriable.rb:46:in times'
from /home/tt/.rvm/gems/ruby-2.0.0-p648/gems/retriable-3.0.1/lib/retriable.rb:46:in retriable' from /home/tt/.rvm/gems/ruby-2.0.0-p648/gems/google-api-client-0.13.0/lib/google/apis/core/http_command.rb:101:in block in execute'
from /home/tt/.rvm/gems/ruby-2.0.0-p648/gems/retriable-3.0.1/lib/retriable.rb:50:in block in retriable' from /home/tt/.rvm/gems/ruby-2.0.0-p648/gems/retriable-3.0.1/lib/retriable.rb:46:in times'
from /home/tt/.rvm/gems/ruby-2.0.0-p648/gems/retriable-3.0.1/lib/retriable.rb:46:in retriable' from /home/tt/.rvm/gems/ruby-2.0.0-p648/gems/google-api-client-0.13.0/lib/google/apis/core/http_command.rb:93:in execute'
from /home/tt/.rvm/gems/ruby-2.0.0-p648/gems/google-api-client-0.13.0/lib/google/apis/core/base_service.rb:360:in execute_or_queue_command' from /home/tt/.rvm/gems/ruby-2.0.0-p648/gems/google-api-client-0.13.0/generated/google/apis/drive_v3/service.rb:740:in export_file'
from read_from_drive.rb:57:in download_file' from read_from_drive.rb:52:in initialize_api'
from read_from_drive.rb:84:in `
'
As per your documentation:
For downloads, the download_dest parameter can also be either a path to a file, an IO stream, or StringIO instance.
The text was updated successfully, but these errors were encountered:
Hi @sqrrrl
I used same mime type for getting file_id and it works for me
response = drive_service.list_files(q: "name='#{file_name}' and mimeType='application/vnd.ms-excel'",
spaces: 'drive',
fields:'nextPageToken, files(id, name)',
page_token: page_token)
so are there different mime types supported for different google drive api's (eg. export, search) ?
I want to download .xls file from google drive.
drive_service.list_files is working fine for me to get file_id but for download following code
drive_service.export_file(file_id,'application/vnd.ms-excel',
download_dest: "/home/tt/Desktop/Automation/TestSheet.xls")
is giving error
/home/tt/.rvm/gems/ruby-2.0.0-p648/gems/google-api-client-0.13.0/lib/google/apis/core/http_command.rb:218:in
'check_status': Invalid request (Google::Apis::ClientError) from /home/tt/.rvm/gems/ruby-2.0.0-p648/gems/google-api-client-0.13.0/lib/google/apis/core/api_command.rb:116:in
check_status'from /home/tt/.rvm/gems/ruby-2.0.0-p648/gems/google-api-client-0.13.0/lib/google/apis/core/download.rb:103:in
execute_once' from /home/tt/.rvm/gems/ruby-2.0.0-p648/gems/google-api-client-0.13.0/lib/google/apis/core/http_command.rb:104:in
block (2 levels) in execute'from /home/tt/.rvm/gems/ruby-2.0.0-p648/gems/retriable-3.0.1/lib/retriable.rb:50:in
block in retriable' from /home/tt/.rvm/gems/ruby-2.0.0-p648/gems/retriable-3.0.1/lib/retriable.rb:46:in
times'from /home/tt/.rvm/gems/ruby-2.0.0-p648/gems/retriable-3.0.1/lib/retriable.rb:46:in
retriable' from /home/tt/.rvm/gems/ruby-2.0.0-p648/gems/google-api-client-0.13.0/lib/google/apis/core/http_command.rb:101:in
block in execute'from /home/tt/.rvm/gems/ruby-2.0.0-p648/gems/retriable-3.0.1/lib/retriable.rb:50:in
block in retriable' from /home/tt/.rvm/gems/ruby-2.0.0-p648/gems/retriable-3.0.1/lib/retriable.rb:46:in
times'from /home/tt/.rvm/gems/ruby-2.0.0-p648/gems/retriable-3.0.1/lib/retriable.rb:46:in
retriable' from /home/tt/.rvm/gems/ruby-2.0.0-p648/gems/google-api-client-0.13.0/lib/google/apis/core/http_command.rb:93:in
execute'from /home/tt/.rvm/gems/ruby-2.0.0-p648/gems/google-api-client-0.13.0/lib/google/apis/core/base_service.rb:360:in
execute_or_queue_command' from /home/tt/.rvm/gems/ruby-2.0.0-p648/gems/google-api-client-0.13.0/generated/google/apis/drive_v3/service.rb:740:in
export_file'from read_from_drive.rb:57:in
download_file' from read_from_drive.rb:52:in
initialize_api'from read_from_drive.rb:84:in `
As per your documentation:
For downloads, the download_dest parameter can also be either a path to a file, an IO stream, or StringIO instance.
The text was updated successfully, but these errors were encountered: