Skip to main content

Fetching Files

To fetch files that have been previously uploaded, use the ductape.storage.files function. This function allows you to retrieve a paginated list of files within your workspace, filtered by optional parameters.

Input Parameters

FieldTypeRequiredDefaultDescription
pagenumberNo0The page number to fetch. Starts from 0.
limitnumberNo20Number of results per page.
eventstringYesnullRequired storage tag of the bucket you want to look up.

Example

const files = await ductape.storage.files({
event: "primary-storage",
page: 0,
limit: 20
});

Output Structure

The data returned is an array of file metadata objects with the following structure:

FieldTypeDescription
urlstringThe public or signed URL for accessing the file.
workspace_idstringThe workspace this file belongs to.
typestringThe file type category.
productstringThe product the file is associated with.
providerstringThe cloud storage provider used (e.g., gcp, azure).
process_idstringThe process run identifier for this file.
eventstringThe event that triggered this file upload.
envstringThe environment this file was uploaded in.
sizenumberThe file size in bytes.

Key Points

  • Use the correct storage tag (event) to fetch files from the right bucket.
  • Pagination is supported via page and limit parameters.
  • Output includes all relevant metadata for each file.

Next Steps