Filters the data for a file before it is uploaded to WordPress.
Description
The dynamic portion of the hook name, $action, refers to the post action. Possible hook names include: <ul> <li>wp_handle_sideload_prefilter</li> <li>wp_handle_upload_prefilter</li> </ul>
Parameters
$filearray
{ Reference to a single element from $_FILES. @type string $name The original name of the file on the client machine. @type string $type The mime type of the file, if the browser provided this information. @type string $tmp_name The temporary filename of the file in which the uploaded file was stored on the server. @type int $size The size, in bytes, of the uploaded file. @type int $error The error code associated with this file upload.}
$namestring
The original name of the file on the client machine.
$typestring
The mime type of the file, if the browser provided this information.
$tmp_namestring
The temporary filename of the file in which the uploaded file was stored on the server.
827* @type string$type The mime type of the file,if the browser provided this information.828* @type string$tmp_name The temporary filename of the file in which the uploaded file was stored on the server.829* @type int$size The size, in bytes, of the uploaded file.830* @type int$error The error code associated with this file upload.831*}832*/833$file=apply_filters("{$action}_prefilter",$file);834835/**836* Filters the override parameters for a file before it is uploaded to WordPress.837*838* The dynamic portion of the hook name,`$action`, refers to the post action.839*
History
Introduced in 4.0.0. Unchanged from 6.7.7 through 7.1.0.