CodeExplorer check_upload_size example
fwrite( $fp,
$data );
fclose( $fp );
// Now, sideload it in.
$file_data = array
( 'error' => null,
'tmp_name' =>
$tmpfname,
'name' =>
$filename,
'type' =>
$type,
);
$size_check = self::
check_upload_size( $file_data );
if ( is_wp_error( $size_check ) ) { return $size_check;
} $overrides = array
( 'test_form' => false,
);
$sideloaded =
wp_handle_sideload( $file_data,
$overrides );
if ( isset( $sideloaded['error'
] ) ) { @