PocketBase 数据库 icon

PocketBase 数据库

与 PocketBase 数据库进行交互

📎 文件 → 🔗 获取文件链接

AI-generated

Summary

Retrieves the public download URL for a specific file stored within a PocketBase record, optionally with thumbnail generation parameters.

Inputs

  • collection (required) — The name of the collection containing the file.
  • recordId (required) — The ID of the record that contains the file.
  • filename (required) — The name of the file within the record's file field.
  • options.thumb — A string defining thumbnail dimensions (e.g., '100x100' or '0x300').

Output shape

A single JSON object containing the file URL and metadata.

The returned URL is a public, time-limited direct link to the file on the PocketBase server. Requires valid credentials for the configured PocketBase instance.

Examples

Example 1: Generate a link to a profile image from a user record.

Select 'users' collection, enter user record ID, specify 'avatar.jpg' filename, and optionally set thumb to '100x100'.

Links

Discussion