Google Drive mime-types listing? [closed]

$mime_types= array( “xls” =>’application/vnd.ms-excel’, “xlsx” =>’application/vnd.openxmlformats-officedocument.spreadsheetml.sheet’, “xml” =>’text/xml’, “ods”=>’application/vnd.oasis.opendocument.spreadsheet’, “csv”=>’text/plain’, “tmpl”=>’text/plain’, “pdf”=> ‘application/pdf’, “php”=>’application/x-httpd-php’, “jpg”=>’image/jpeg’, “png”=>’image/png’, “gif”=>’image/gif’, “bmp”=>’image/bmp’, “txt”=>’text/plain’, “doc”=>’application/msword’, “js”=>’text/js’, “swf”=>’application/x-shockwave-flash’, “mp3″=>’audio/mpeg’, “zip”=>’application/zip’, “rar”=>’application/rar’, “tar”=>’application/tar’, “arj”=>’application/arj’, “cab”=>’application/cab’, “html”=>’text/html’, “htm”=>’text/html’, “default”=>’application/octet-stream’, “folder”=>’application/vnd.google-apps.folder’ ); In addition, here is a list of mime-types specifically pertaining to Google drive (and the google suite): https://developers.google.com/drive/v3/web/mime-types

Is it possible to send HTTP request from inside Google docs?

Using Google Apps Script, you can make HTTP requests to external APIs from inside Google Docs/Sheets/etc. using the UrlFetchApp class: var url=”https://gdata.youtube.com/feeds/api/videos?” + ‘q=skateboarding+dog’ + ‘&start-index=21’ + ‘&max-results=10’ + ‘&v=2’; var response = UrlFetchApp.fetch(url); Logger.log(response); Note that: This service requires the https://www.googleapis.com/auth/script.external_request scope. In most cases Apps Script automatically detects and includes the scopes a … Read more

Download a file from google drive using wget

Insert your file ID into this URL (https://drive.google.com/uc?export=download&id=), then surround the URL with quotes so that Bash doesn’t misinterpret the &, like so: wget “https://drive.google.com/uc?export=download&id=0Bz7KyqmuGsilT0J5dmRCM0ROVHc” Reference here. When downloading big files, Google Drive adds a security warning that breaks the script above. In that case, you can download the file using: wget –load-cookies /tmp/cookies.txt “https://docs.google.com/uc?export=download&confirm=$(wget … Read more

Using the google drive API to download a spreadsheet in csv format

Update: I have posted another answer that works with the Spreadsheets v4 API. Old Answer: The answer from Alain is correct, but you also need to set the gid=parameter to specify which worksheet to export. For example, if your ‘application/pdf’ export link is like this: docs.google.com/feeds/download/spreadsheets/Export?key=<FILE_ID>&exportFormat=pdf You can just change it to this to download … Read more

Colaboratory: Can I access to my Google drive folder and file?

Here’s an example of using a FUSE Drive interface to access your Drive files like local files: https://colab.research.google.com/notebook#fileId=1srw_HFWQ2SMgmWIawucXfusGzrj1_U0q In short: # Load the Drive helper and mount from google.colab import drive drive.mount(‘/content/drive’) After executing the code above, your Drive files will be present in /content/drive/My Drive. I’m guessing you also found the bundled example I/O … Read more