Reference

Guide

file.update:before

$file, $input

Example

/site/config/config.php
return [
    'hooks' => [
        'file.update:before' => function ($file, $input) {
            // your code goes here
        }
    ]
]