function upload_is_file_too_big( $upload ) {}

Check whether an upload is too big.


  • array $upload

Return values

returns:If the upload is under the size limit, $upload is returned. Otherwise returns an error message.

Source code

function upload_is_file_too_big( $upload ) {

	if ( is_array( $upload ) == false || defined( 'WP_IMPORTING' ) )

		return $upload;

	if ( strlen( $upload['bits'] )  > ( 1024 * get_site_option( 'fileupload_maxk', 1500 ) ) )

		return sprintf( __( 'This file is too big. Files must be less than %d KB in size.' ) . '<br />', get_site_option( 'fileupload_maxk', 1500 ));

	return $upload;



No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: