Hi,
Please check the example: https://snippet.svar.dev/react/VkZUItYxk
Once a file is selected, the Filemanagertriggers the create-file action, which you can intercept or listen to in order to handle the upload to your server.
The onCreateFileprop gives you the ability to listen for the create-file action. This prop is automatically converted by the Filemanagercomponent into an event handler that gets called every time a file is created (through the Upload button or any other ways). Using this prop is the simplest approach because you don’t need to manually register event handlers.
The initfunction is a callback that receives the Filemanager’s API object as its argument. This API gives you access to the internal events of the component. Inside init, you can call api.on("create-file", handler) to register a listener for the create-file action. This listener will be invoked every time the action is executed, allowing you to react to file creation events. The advantage of using init is that you have access to the full API, including methods like exec, intercept, getState, and others.