Enum MimeType

  • The MimeType enumeration provides access to MIME-type declarations without explicit string typing.

  • Methods expecting a MIME type as a string also accept values from the MimeType enumeration if the underlying MIME type is supported.

  • MimeType includes properties for various file types such as Google Docs, Images (PNG, JPEG), PDFs, Text files, and Microsoft Office files.

MimeType

An enumeration that provides access to MIME-type declarations without typing the stringsexplicitly. Methods that expect a MIME type rendered as a string (for example,'image/png') also accept any of the values below, so long as the method supports theunderlying MIME type.

// Use MimeType enum to log the name of every Google Doc in the user's Drive.constdocs=DriveApp.getFilesByType(MimeType.GOOGLE_DOCS);while(docs.hasNext()){constdoc=docs.next();Logger.log(doc.getName());}// Use plain string to log the size of every PNG in the user's Drive.constpngs=DriveApp.getFilesByType('image/png');while(pngs.hasNext()){constpng=pngs.next();Logger.log(png.getSize());}

Properties

PropertyTypeDescription
GOOGLE_APPS_SCRIPTEnumRepresentation of MIME type for a Google Apps Script project.
GOOGLE_DRAWINGSEnumRepresentation of MIME type for a Google Drawings file.
GOOGLE_DOCSEnumRepresentation of MIME type for a Google Docs file.
GOOGLE_FORMSEnumRepresentation of MIME type for a Google Forms file.
GOOGLE_SHEETSEnumRepresentation of MIME type for a Google Sheets file.
GOOGLE_SITESEnumRepresentation of MIME type for a Google Sites file.
GOOGLE_SLIDESEnumRepresentation of MIME type for a Google Slides file.
FOLDEREnumRepresentation of MIME type for a Google Drive folder.
SHORTCUTEnumRepresentation of MIME type for a Google Drive shortcut.
BMPEnumRepresentation of MIME type for a BMP image file (typically .bmp).
GIFEnumRepresentation of MIME type for a GIF image file (typically .gif).
JPEGEnumRepresentation of MIME type for a JPEG image file (typically .jpg).
PNGEnumRepresentation of MIME type for a PNG image file (typically .png).
SVGEnumRepresentation of MIME type for an SVG image file (typically .svg).
PDFEnumRepresentation of MIME type for a PDF file (typically .pdf).
CSSEnumRepresentation of MIME type for a CSS text file (typically .css).
CSVEnumRepresentation of MIME type for a CSV text file (typically .csv).
HTMLEnumRepresentation of MIME type for an HTML text file (typically .html).
JAVASCRIPTEnumRepresentation of MIME type for a JavaScript text file (typically .js).
PLAIN_TEXTEnumRepresentation of MIME type for a plain text file (typically .txt).
RTFEnumRepresentation of MIME type for a rich text file (typically .rtf).
OPENDOCUMENT_GRAPHICSEnumRepresentation of MIME type for an OpenDocument graphics file (typically .odg).
OPENDOCUMENT_PRESENTATIONEnumRepresentation of MIME type for an OpenDocument presentation file (typically .odp).
OPENDOCUMENT_SPREADSHEETEnumRepresentation of MIME type for an OpenDocument spreadsheet file (typically .ods).
OPENDOCUMENT_TEXTEnumRepresentation of MIME type for an OpenDocument word-processing file (typically .odt).
MICROSOFT_EXCELEnumRepresentation of MIME type for a Microsoft Excel spreadsheet file (typically .xlsx).
MICROSOFT_EXCEL_LEGACYEnumRepresentation of MIME type for a Microsoft Excel legacy file (typically .xls).
MICROSOFT_POWERPOINTEnumRepresentation of MIME type for a Microsoft PowerPoint presentation file (typically .pptx).
MICROSOFT_POWERPOINT_LEGACYEnumRepresentation of MIME type for a Microsoft PowerPoint legacy file (typically .ppt).
MICROSOFT_WORDEnumRepresentation of MIME type for a Microsoft Word document file (typically .docx).
MICROSOFT_WORD_LEGACYEnumRepresentation of MIME type for a Microsoft Word legacy file (typically .doc).
ZIPEnumRepresentation of MIME type for a ZIP archive file (typically .zip).

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-12-11 UTC.