Changing ROOTDIR of FileManager with subdirectory

I like to make create a web storage service for users.

Users are created and used using WEBIX USER_MANAGER Widget.
I have Simple Login page based on users in USER_MANAGER and it returns “USERID”
Suppose all USER files are stored in /mnt/webix/$USERID directories.

I want users to access their files stored under /mnt/webix/USERID/

I can not seem to find simple way to configure/overide ROOTDIR as “/mnt/webix/” + $USERID.

Can you instruct the simplest and best way to do this?

This was resolved at support@webix.com a while ago, but I’ll post the answer here for others who may be interested in this topic:

Although the solution depends on these requirements, here are the most common options for similar use-cases:

Each action has a related method of the Backend service that performs the request and returns the Promise object with the server response.
All these methods use the base URL defined in FM configuration + URL segment that is suitable for the action + related parameters, so in general, it is enough to modify the URL for the needed request.


1) If the initialization of the file manager takes please after the user has logged in to the system and the URL with user ID is used in all requests, the user ID can be simply added directly to the link: https://snippet.webix.com/8kn1twag
2) If some requests should include the $USERID in the URL and some are not, the related methods can be specifically customized (regardless of the request method - GET, POST, etc.). Unfortunately, our backend does not support customized requests, but the code can look as follows: https://snippet.webix.com/2dpqa2fq
3) However, if the root path should be completely changed at runtime (e.g. if users' accounts were switched without re-initializing File Manager view and you only need to reload the data), it requires more complex changes (as you will need to clear all previous states and data), but still possible. The following demo changes the root for loading **files**, **folders**, and **search**. Other methods (path to icons, uploading and downloading, the path to file preview) were untouched and will point to default common root.

The demo backend does not support such modifications as well and won’t provide the data per such requests, but the actual URLs can be inspected in the devtools: Code Snippet

The root will be changed respectively to

(default) main_root/
main_root/Documents/
main_root/Music/
main_root/Photos/

The local operations performed to clear previous data are described in the related docs chapter.