Actions2
Overview
This node integrates with a Media Kit API to manage media files. It supports two main operations:
- Upload Media: Uploads media content either from binary data available in the workflow or directly from a provided media URL.
- List Media: Retrieves a paginated list of uploaded media items.
The Upload Media operation is useful when you want to programmatically upload files to a media hosting service, for example, uploading images or videos processed earlier in your workflow or fetching and uploading media from external URLs.
The List Media operation helps to retrieve existing media files stored in the system, which can be used for further processing or display.
Practical Examples
- Automatically upload an image file received as binary data from a previous node (e.g., HTTP Request or Image Processing node).
- Fetch an image from a public URL and upload it to your media storage.
- Retrieve a list of all uploaded media files to display or process them further.
Properties
| Name | Meaning |
|---|---|
| Binary Data Name | The name of the binary property containing the media data to upload. |
| Media URL | A valid URL pointing to the media file to upload. |
Note: Only one of "Binary Data Name" or "Media URL" should be provided for the upload operation.
Output
For Upload Media, the output JSON contains details about the uploaded file:
fileName: Original or derived file name.mimeType: MIME type of the uploaded media.fileExt: File extension.fileSize: Size of the uploaded file in bytes.uploadedFileUrl: The URL where the uploaded media is accessible.
For List Media, the output JSON is a paginated list of media items retrieved from the API.
The node does not output binary data itself but works with binary input for uploads.
Dependencies
- Requires an API key credential to authenticate with the Media Kit API.
- Uses internal helper functions to interact with the Media Kit API endpoints.
- Relies on external libraries for MIME type detection and URL validation.
- The node expects the environment to support network requests to the Media Kit API.
Troubleshooting
Error: "Only one of binaryDataName or mediaUrl can be provided"
Occurs if both binary data and media URL are specified simultaneously. Provide only one input source.Error: "Invalid media URL"
Happens if the provided media URL is not a valid URI. Ensure the URL is correctly formatted and accessible.Error: "No binary data name or media URL provided"
Indicates that neither input was given for upload. Specify either a binary data property or a media URL.Error: "No upload URL received from server" or "No URL found in the upload response"
Suggests an issue with the Media Kit API response during upload initialization or completion. Check API availability and credentials.Network or authentication errors may occur if the API key credential is missing or invalid.
Links and References
- Media Kit API Documentation (Replace with actual URL if available)
- n8n Documentation on Working with Binary Data
- Tus Protocol for Resumable Uploads