Media library upload hook

I think what you need is media_upload_{$type} hook.
Here’s the documentation for it: https://developer.wordpress.org/reference/hooks/media_upload_type/

There’s also an easier way to achieve a similar result, by using the filter wp_handle_upload which is really straightforward.
Here’s the doc about it: https://developer.wordpress.org/reference/hooks/wp_handle_upload/

If you could provide more details about the result you want to achieve, I’ll try my best to help you with some more specific code!