-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
Common Problems & Solutions When Setting Up elfinder-node (Windows/Node.js)
1. Setting up connectors and file paths
- Problem: Issues with
targethashes, root paths, and connector URLs (especially on Windows). - Solution: Double-check your connector configuration (
roots,path,URL) in the backend. Ensure paths use correct slashes (\for Windows,/for Linux). For initial blank targets, patch to use the correct hash (e.g.,v0_Lwfor/root).
2. "The string to be encoded contains characters outside of the Latin1 range."
- Problem: Base64 encoding/decoding fails with non-Latin1 strings (Unicode paths, etc.).
- Solution: Replace uses of the
base-64npm package with Node.jsBufferfor base64 encoding/decoding inlfs.utils.js:This works for all Unicode file paths.const base64 = { encode: (str) => Buffer.from(str, 'utf8').toString('base64'), decode: (str) => Buffer.from(str, 'base64').toString('utf8') };
3. Search fails: "TypeError: fs.walk is not a function"
- Problem: elfinder-node's search uses the deprecated
fs.walkAPI, which is not present in recentfs-extra. - Solution: Replace the
api.searchimplementation inLocalFileStorage.jswith a custom async recursive function usingfs.readdirandfs.stat:This removes the dependency onapi.search = async function (opts, res) { // ... see detailed code in thread ... };
fs.walkand works for all directory trees.
General Tip
- Always check your Node.js version and your dependencies (
fs-extra, etc.). - If you update elfinder-node, re-apply these fixes as needed.
Thanks to the community for their help! If you need more details, see the full discussion or ask below.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels