Upload Book
AI-generatedOverview
This node integrates with Calibre-Web, a web application for managing eBook libraries. It allows users to upload new books directly into their Calibre-Web library from n8n workflows. This is particularly useful for automating the addition of eBooks from various sources or preprocessing steps without manual intervention.
Typical use cases include:
- Automatically adding newly downloaded or generated eBooks to Calibre-Web.
- Integrating with other systems that produce eBooks, enabling seamless library updates.
- Batch uploading multiple books by feeding binary data into the node.
Properties
| Name | Meaning |
|---|---|
| Binary Property | The name of the binary property on the input item that contains the file to be uploaded. |
The only configurable property for the "Upload Book" operation is the Binary Property, which specifies where in the incoming data the book file is stored as binary data.
Output
The node outputs an array of JSON objects, one per input item processed. Each output object has the following structure:
{
"success": true,
"location": "/some/path/or/url"
}
success: A boolean indicating whether the upload was successful.location: A string representing the location returned by Calibre-Web after the upload (likely a redirect URL or path).
If an error occurs and the node is configured to continue on failure, the output will contain an error message instead:
{
"error": "Error message describing what went wrong"
}
The node does not output any binary data.
Dependencies
- Requires an API authentication credential containing at least:
- Base URL of the Calibre-Web instance.
- Username and password for login.
- Uses HTTP requests to interact with Calibre-Web's web interface, including handling CSRF tokens and cookies.
- Relies on the
axiosandform-datalibraries for HTTP communication and multipart form uploads. - The node expects the Calibre-Web server to expose a login page and upload endpoint compatible with the described flow.
Troubleshooting
Common Issues
- No binary data found: If the specified binary property does not exist on the input item, the node throws an error. Ensure the binary data is correctly named and present.
- Authentication failures: Errors related to missing CSRF tokens or invalid credentials indicate problems logging into Calibre-Web. Verify username, password, and base URL.
- Upload failures: Network issues, incorrect URLs, or server-side errors can cause upload to fail.
Error Messages
"No binary data exists on item!": The binary property specified does not exist on the current item."Authentication failed: CSRF token not found on login page": The node could not find the required CSRF token during login, possibly due to changes in Calibre-Web or incorrect URL."Authentication failed"with description"Invalid username or password": Credentials are incorrect."Authentication failed: CSRF token not found for upload": Failed to retrieve CSRF token needed for the upload request."Request failed: <message>": Generic HTTP request failure; check network connectivity and server status."An unexpected error occurred": Catch-all for other exceptions; review logs for details.
To resolve these issues:
- Double-check credentials and base URL.
- Confirm the binary property name matches the input data.
- Ensure the Calibre-Web instance is accessible and supports the expected endpoints.
- Enable detailed logging to diagnose HTTP request failures.
Links and References
- Calibre-Web GitHub Repository – Official project page for Calibre-Web.
- Calibre-Web Documentation – For understanding the web interface and API behavior.
- n8n Documentation – General guidance on creating and using custom nodes.