Synology FileStation icon

Synology FileStation

Implements Synology File Station Official API

Overview

This node integrates with Synology File Station's official API to upload files to a specified shared folder on a Synology NAS device. It supports uploading either text content or binary files, making it versatile for various automation workflows involving file management on Synology devices.

Common scenarios where this node is beneficial include:

  • Automating backups by uploading generated reports or logs to a NAS.
  • Uploading processed images or documents from other workflow steps directly to Synology storage.
  • Integrating with other systems that produce files needing centralized storage on Synology NAS.

For example, you could use this node to upload a dynamically created CSV report (as text content) or an image file received from a previous node in binary form to a specific folder on your NAS.

Properties

Name Meaning
Path Destination folder path starting with a shared folder on the Synology NAS where the file will be uploaded.
Create Parent Folders Whether to create parent folders if they do not exist (true or false).
Overwrite Whether to overwrite existing files with the same name (true or false).
File Name The name of the file to be uploaded.
Binary File Whether the file data should be taken from a binary input field (true) or from text content (false).
File Content The text content of the file to upload (used only if "Binary File" is false).
Input Binary Field The name of the input binary field containing the file to be uploaded (used only if "Binary File" is true).

Output

The node outputs an array with one element per input item. Each output item contains a json object with the response data from the Synology File Station API after attempting the upload.

  • If the upload is successful, the json field includes the data object returned by the API, which typically contains metadata about the uploaded file.
  • If the upload fails and the node is set to continue on failure, the output item will contain an empty json object and an error field with the error code as a string.

The node does not output binary data.

Dependencies

  • Requires connection to a Synology NAS with File Station API enabled.
  • Needs an API authentication token credential configured in n8n to authenticate requests.
  • Uses HTTP POST requests with multipart/form-data encoding to upload files.
  • Relies on n8n helpers for handling binary data and authenticated HTTP requests.

Troubleshooting

  • Common issues:

    • Incorrect or missing destination path can cause upload failures.
    • Insufficient permissions on the Synology NAS for the API user may prevent file uploads.
    • Specifying a non-existent binary field name when "Binary File" is enabled will cause errors.
    • Network connectivity issues to the Synology NAS URL will result in request failures.
  • Error messages:

    • API errors returned by Synology are included in the node's output under the error field if continuing on fail.
    • Errors related to missing binary data fields will be thrown by the node; ensure the binary property name matches the input data.
    • Authentication errors indicate problems with the provided API credentials.

To resolve these issues:

  • Verify the destination path and ensure it starts with a valid shared folder.
  • Confirm the API user has appropriate permissions on the NAS.
  • Double-check the binary field name if uploading binary data.
  • Ensure network access to the NAS URL and correct API credentials.

Links and References

Discussion