How to use OCP core events

hi
i want to use OCP file events in my app.
after upload a file in nextcloud , we want to get some metadata from the file , we need a sample code , and how to use them ( i read docs , but it seems document is old ).
thank you.

Events are documented at https://docs.nextcloud.com/server/stable/developer_manual/basics/events.html. The document is up to date.