Skip to main content

URL File Sync

File Synchronization Handler

BRICKS TOOLS avatar
Written by BRICKS TOOLS
Updated over a week ago


The File Sync Handler is used to synchronize a list of cloud file links and periodically update the files.


  • Local Sync Block

RunMode

one of


List


Defines the execution method when Local Sync is enabled in DEVICE settings and multiple devices run the same application under the same local network.

  • all: All devices execute the handler when triggered.

  • main-only: Only the highest-priority device (defined in Local Sync) executes the handler.

  • minor-only: Only the lowest-priority device (defined in Local Sync) executes the handler.


  • Properties Block

Auto Sync

Boolean


Boolean (Yes/No)


Sets whether file links are automatically synchronized.

Auto Sync Interval

Number


milliseconds


Sets the interval for automatic synchronization. Default: 60 seconds.

Local Dir Path

String


String


Sets the local device file URL path.

Add TimeStamp

Boolean


Boolean (Yes/No)


Sets whether to append a timestamp to each synchronized file URL.

File List

ArrayOf


Array of Strings


Defines the list of files to sync. Each entry must include the following parameters:

  • url: (string) file URL

  • id: (string) file ID

  • md5: (string) file MD5 checksum

  • extension: (string) file extension (e.g., "jpg", "png", "mp4")
    These parameters help ensure that files are not redundantly downloaded during each sync.

Key Prop

OneOf


List


Sets the naming method for synchronized files.

  • hash: Uses the MD5 hash value calculated from the file URL.

  • id: Uses the file’s ID.

Content Type

String


String


Sets a default file extension when no extension is specified in the File List.

Load Size Limit

String


String


Sets the file size limit (e.g., * GB, * MB, * KB).

Allow Load Size Limit Exceed

Boolean


Boolean (Yes/No)


Sets whether files exceeding the size limit can still be loaded. This is mainly used for triggering events.

Download Mode

OneOf


List

Sets the download mode for files in the list.

  • concurrent: All files are downloaded simultaneously.

  • sequence: Files are downloaded in sequence.


  • Events Block

Download Completed


Triggered when the file list synchronization finishes downloading.

File Size Exceed


Triggered when a file exceeds the configured Load Size Limit.


  • Outlets Block

Status


Outputs the current file synchronization status as a string.

Progress


File Urls


Outputs the final list of file URLs as an array of objects.


  • Operation Block

    • Inspect this Generator

      • Displays the relationship between the Generator, Events, and Property Bank.

      Event Routing

      • Shows the event/calculation flow, indicating which bricks/generators/properties are affected. Useful for troubleshooting event dependencies.

      Parent Call

      • Displays which bricks/generators/property calculations triggered this handler. Unlike Event Routing (which traces downstream), Parent Call traces upstream from the source.

      Copy

      • Creates a copy of this Generator handler.

      Remove this Generator

      • Removes this Generator handler.

Did this answer your question?