Skip to content

Google App Script downloading .heic form attachments #1465

@rlopbc

Description

@rlopbc

Related Product
Which product is this question related to?

API

Describe the question
We have a Google App Script that fetches form submissions from the People API and downloads the attachments directly from the url values in the attachments array (s3.amazonaws.com/uploads/form_submission_value...). We're encountering a strange bug where most file formats are downloaded just fine (eg. png, jpg, pdf), but the script fails consistently on .heic files (ie. mobile image capture).

What have you tried that worked?

Narrowed it down to specifically to GAS UrlFetchApp.fetch(...) failing with Unexpected error. All other filetype attachments seem to work fine. Current hypothesis is that perhaps the .heic files are returned with extremely large/heavy metadata in the headers, and the script is getting tripped up by that. If I copy the url directly into a browser, the download works just fine, so it's a GAS specific issue.

What have you tried that didn't work?

Passing various options and header metadata to UrlFetchApp.fetch(...), muting http exceptions, stripping parameters from the s3.amazonaws.com url....

Additional context

Any tips or suggestions welcome! Either ideas on solutioning, or even ideas on how to further debug the issue.

I have..

  • [ x] Reviewed the documentation found at https://developer.planning.center/docs
  • [ x] Searched for previous issues answering this question
  • [ x] Removed all private information from this issue (credentials, tokens, emails, phone numbers, etc.)
  • Reviewed my issue for completeness

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions