Skip to main content
FrogBot adds no files collection. Mark one upload collection with file: true to give pieces a place to store files. The collection appears under Collections in the admin panel and defines no custom fields unless you add them. FrogBot supplies upload metadata such as the filename, MIME type, size, and URL.

Adopt your collection

Give one upload collection the file: true marker to use it as FrogBot’s file store:
That collection gets uploads, folders, soft deletion, admin list defaults, and access that requires an authenticated user. Your own fields, access rules, upload options, and other collection settings take precedence. A larger example can set its own slug, upload options, and fields:
A collection marked file: true must not set upload: false. Mark only one collection as file: true. A collection cannot hold another FrogBot role, such as chat: true, at the same time.

Folders

Files sit in folders. FrogBot adds a folders collection, folders, with a name field and folders: true, and gives the collection marked file: true a folder field, _h_folders, which the admin panel shows as a folder picker. Folders nest inside each other. To use your own folders collection, set folders: true on it; FrogBot files into that one instead and doesn’t add folders. Any other collection can file into it too:

Storage

FrogBot stores uploads on local disk unless you configure a storage adapter. For production and serverless deployments, add an upload storage adapter to storage. The adapter covers the collection marked file: true, if any, and frogbot-chat-assets when chat is enabled, automatically; you don’t list them in the adapter’s collections.

Access

A collection marked file: true requires an authenticated user to create, read, update, or delete files unless you set your own access rules.
Files do not have per-user ownership or sharing rules. Authenticated users can access every file allowed by the collection’s access rules.

Keep existing files

FrogBot adds no files collection of its own. An app that stores files in files keeps them by declaring that collection with file: true:
Without a marked collection, the next schema change in an existing app drops these tables:
  • the files table;
  • folders, when no other collection enables folders;
  • frogbot_trigger_subscriptions, when no agent has a trigger or channel.
In development mode, schema push warns about the data loss and drops the tables only if you confirm. frogbot migrate:create writes the DROP TABLE statements into the migration for you to review before applying it. Stored files stay on disk or in the storage adapter, but no document references them anymore. On MongoDB the data stays, but FrogBot can’t reach it.

Piece output

Pieces that create files write to the collection marked file: true. Without one, those actions fail when they run: