IP Inlay for FileMaker

Inlay Function Reference Media

Media

Container inspection, image loading, and WebViewer drop zones. 4 functions.

Inlay_INSPECT_CONTAINER

Media Updated Returns JSON

Returns JSON describing the contents of a FileMaker container field.

Reads the container's binary streams without writing anything to disk. The report lists each embedded stream with its type and byte size, the total byte size across all streams, and image pixel dimensions when the container holds an image.

Declaration

Inlay_INSPECT_CONTAINER ( MyTable::ImageContainer )

Parameters

Container Required
a FileMaker container field or container value to inspect.

Returns

JSON string On success returns {"ok":true,"stream_count":N,"total_size_bytes":N,"dimensions":{"height":H,"width":W},"streams":[{"index":0,"type":"JPEG","size_bytes":N}]}. An empty container returns {"ok":false,"message":"container is empty"}.

Use Cases

  • Validate that an uploaded container actually holds image data and read its pixel dimensions before display or processing.
  • Detect oversized container payloads by checking total_size_bytes before syncing them to storage.

Notes

  • dimensions are populated only when the container holds an image stream; non-image containers report zero width and height.
  • The type field reflects the FileMaker stream type of each embedded stream (for example JPEG, PNG, PDF, or FILE).

See Also

Inlay_LOAD_IMAGE Inlay_LOAD_REMOTE_IMAGE

Inlay_LOAD_IMAGE

Media Updated Returns JSON

Loads a local file from disk and returns it as a FileMaker container value.

The container's stream type is chosen from the file extension so FileMaker renders the result inline. JPEG, PNG, GIF, and BMP load as images and PDF loads as a PDF. Any other extension is stored as a generic file stream.

Declaration

Inlay_LOAD_IMAGE ( "/Users/alice/Pictures/photo.jpg" )

Parameters

Path Required
location of the file to load. Accepts a bare HFS path (Macintosh HD:Users:...), a filemac:/... URL, a file:/... URL, or a POSIX path (/Users/...).

Returns

JSON string On success returns the file as a FileMaker container. On failure returns the text {"ok":false,"message":"..."}, for example when the path cannot be parsed or the file is not found.

Use Cases

  • Pull a JPEG or PNG from a watched folder into a container field without an Insert File script step.
  • Load a generated PDF from a temporary path back into a container for storage or printing.

Notes

  • Extension detection is case insensitive; an unrecognized extension is stored as a generic file stream rather than rejected.
  • The whole file is read into memory, so very large files are limited by available RAM.

See Also

Inlay_LOAD_REMOTE_IMAGE Inlay_INSPECT_CONTAINER

Inlay_LOAD_REMOTE_IMAGE

Media Updated Returns JSON

Downloads a file from a URL and returns it as a FileMaker container, with optional local caching.

Results are cached on disk so repeated calls for the same URL avoid re-downloading. TtlHours and SourceDate together control how long a cached copy stays fresh, and EncryptKey encrypts the cached bytes at rest.

Declaration

Inlay_LOAD_REMOTE_IMAGE ( JSONSetElement ( "{}" ;
    [ "Url" ; "https://example.com/image.jpg" ; JSONString ] ;
    [ "TtlHours" ; 24 ; JSONNumber ]
  ) )

Parameters

Url Required
the URL to download.
TtlHours Optional
hours a cached copy stays fresh, defaulting to 0 (no time-based caching).
EncryptKey Optional
passphrase used to encrypt and decrypt the cached file. A cached entry written with one key cannot be read with another.
SourceDate Optional
a source last-modified date. A cached entry older than this date is treated as stale and re-fetched.

Returns

JSON string On success returns the downloaded file as a FileMaker container. On failure returns the text {"ok":false,"message":"..."}, for example on a fetch or read error.

Use Cases

  • Display a remote product or avatar image in a container field while caching it for fast repeat loads.
  • Re-fetch a cached asset automatically when its source record's modified date is newer by passing SourceDate.

Notes

  • When EncryptKey is supplied, a cache hit that fails to decrypt is discarded and the file is re-fetched.
  • Legacy keys url, ttlHours, encryptKey, and sourceDate are accepted for one release cycle.

See Also

Inlay_LOAD_IMAGE Inlay_INSPECT_CONTAINER Inlay_S3_GET

Inlay_RENDER_DROPZONE_HTML

Media Returns JSON

Renders an HTML drop zone for a WebViewer.

When the user drags one file onto the WebViewer, the file's raw bytes are streamed to a loopback HTTP server inside the plugin and written to a temporary file. No Base64 conversion is involved and the file is never buffered whole in memory, so a drop larger than available RAM still works. Once the file is on disk, the drop-zone page calls the FileMaker script Inlay_DropZoneCallback, passing a JSON description of the temp file.

Declaration

Inlay_RENDER_DROPZONE_HTML ( JSONSetElement ( "{}" ;
    [ "PromptText?" ; "Drop_a_file_here" ; JSONString ] ;
    [ "MaxSizeBytes?" ; 0 ; JSONNumber ] ;
    [ "ImageUrl?" ; "" ; JSONString ]
  ) { ; SourceContainer } )

Parameters

PromptText Optional
label shown inside the drop zone. Default "Drop a file here".
MaxSizeBytes Optional
reject drops larger than this many bytes. Omit or 0 for unlimited.
ImageUrl Optional
an image shown above the prompt text. Accepts an https URL or a data: URI. Omit for a text-only drop zone.
SourceContainer Optional
a FileMaker container field whose image is shown above the prompt text. The plugin reads the container bytes and embeds them as a data: URI, picking the MIME automatically from the typed image stream (JPEG, PNG, GIF, BMP) or by sniffing the FILE stream for WebP or SVG. If the container holds bytes that are not a recognized image format, the call returns an error. Passing both ImageUrl and SourceContainer is rejected to keep intent explicit.

Returns

JSON string A JSON envelope. On success: ok:true plus url (set a WebViewer to this address), port, and token. On failure: ok:false plus message.

Use Cases

  • See example and related functions for usage context.

See Also

Inlay_S3_RENDER_MEDIA_HTML Inlay_S3_COPY