How to store a ZIP uploaded to an Attachment property in an Object Type, then extract it into a MediaSet (or store it in a backend dataset)

Hi everyone :waving_hand:

I’m currently working on an Ontology workflow where users upload ZIP files through an Attachment property on an Object Type (Lot).

The goal is to:

  1. Let users upload a .zip file directly into the object (stored under Lot.media).

  2. Then automatically unzip the contents (PDFs) and push them into a MediaSet for further processing in pipelines.

    What I’m trying to figure out is how to access and store the ZIP attachment at the backend layer — ideally into a dataset or directly into a MediaSet — so it can be extracted programmatically.


Questions:

  • Is there a recommended approach for reading an Attachment file from an object and saving it into a dataset or MediaSet inside a Foundry Function or Transform?

  • Can we directly unzip the Attachment bytes into a MediaSet using the code or do we need to first move the attachment to a dataset?

  • If the latter, what’s the cleanest way to store the uploaded Attachment ZIP into a dataset so that downstream transforms can read and convert it into a MediaSet?