class DriveApp method .getBlob()

DriveApp is the Apps Script service.

.getBlob() is the method name you will see after a dot in your code.

What it does

Returns the file contents as a blob for reading or exporting.

Why it's used

  • Read file bytes to attach to an email or send to an API.
  • Import CSV or image content into a sheet.

Common errors

  • Forgetting parentheses on getBlob. Write DriveApp.getBlob(), not DriveApp.getBlob or getBlob by itself.
  • Skipping dots between chained calls. Each step needs a dot, like DriveApp.getFileById(id).getBlob().
  • Adding spaces where they do not belong. Write DriveApp.getBlob(), not DriveApp .getBlob(), DriveApp.getBlob (), or DriveApp . getBlob().
  • Wrong capitalization. Use DriveApp and getBlob, not driveapp or getblob.

1 Snippets using this method

Explore

Related methods

1 Better Sheets tutorials

Automatic Screenshots in Apps Script

Automatic Screenshots in Apps Script

Related blog posts

Written guides about DriveApp.getBlob().

Browse the blog