Hook for validating and rejecting frontend image upload

I found it after trying with several hooks.

Use ‘init’ and check if $_FILES is empty, if not, do what you want to do.

init hook

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)