When you upload Media from your WordPress admin dashboard, wp_handle_upload is called once for each file the user specified. wp_handle_upload_prefilter is an admin filter that is called by the wp_handle_upload function. The single parameter, $file, represent a single element of the $_FILES array. The wp_handle_upload_prefilter provides you with an opportunity to examine or alter the filename before the file is moved to its final location.
Using this, in conjunction with the upload_dir, you can dynamically determine which directory to upload to, based on the files you upload.
Example: Prevent images larger than 200kb from being uploaded.
It is not deprecated, it is converted to a dynamic hook with `$action` since 4.0. – track
Example: prepend all uploaded files with
wordpress-is-awesome-
(According to https://wordpress.stackexchange.com/a/333935/5986 this code was originally in the docs. I’m adding it here again since I can’t find it anywhere else.)
This Filter appears to be Depreciated as of WordPress version 4.4