Skip to content

List of MIME type short keys

Eren Inan Canpolat edited this page Jul 22, 2015 · 2 revisions

You can coerce a MIME type when pushing or creating a new file remotely. This page provides a exhaustive list of all MIME type short keys supported by drive.

Push

It's possible to coerce a MIME type with Google Drive pushes using the -coerced-mime flag with a short-key. Example usage:

$ drive push -coerced-mime docx my_test_doc

Below is a list of short keys and corresponding MIME types you can use with the -coerced-mime flag.

Note that short keys use regular expression syntax. That is to say, html? (with a question mark) means you can either use htm or html; te?xt means you can either use txt or text, etc.

Text

csv:   text/csv
html?: text/html
te?xt: text/plain
xml:   text/xml

Image

gif:   image/gif
png:   image/png
svg:   image/svg+xml
jpe?g: image/jpeg

Office Document

odt: application/vnd.oasis.opendocument.text
odm: application/vnd.oasis.opendocument.text-master
ott: application/vnd.oasis.opendocument.text-template
ods: application/vnd.oasis.opendocument.sheet
ots: application/vnd.oasis.opendocument.spreadsheet-template
odg: application/vnd.oasis.opendocument.graphics
otg: application/vnd.oasis.opendocument.graphics-template
oth: application/vnd.oasis.opendocument.text-web
odp: application/vnd.oasis.opendocument.presentation
otp: application/vnd.oasis.opendocument.presentation-template
odi: application/vnd.oasis.opendocument.image
odb: application/vnd.oasis.opendocument.database
oxt: application/vnd.openofficeorg.extension

rtf: application/rtf
pdf: application/pdf

docx?: application/vnd.openxmlformats-officedocument.wordprocessingml.document
pptx?: application/vnd.openxmlformats-officedocument.wordprocessingml.presentation
xlsx?: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet

Others

json:  application/json
js:    application/x-javascript

apk:   application/vnd.android.package-archive
bin:   application/octet-stream
tiff?: image/tiff
tgz:   application/x-compressed
zip:   application/zip

mp3:   audio/mpeg

Create

When creating a new file, you can use the --mime-key flag to assert a MIME type as follows:

$ drive new --mime-key <short-key>

In addition to the list posted above for push, the following short keys can be used to coerce a MIME type for created files:

docs:         application/vnd.google-apps.document
folder:       application/vnd.google-apps.folder
form:         application/vnd.google-apps.form
mp4:          video/mp4
presentation: application/vnd.google-apps.presentation
sheet:        application/vnd.google-apps.spreadsheet
script:       application/vnd.google-apps.script