WordPress.org

Support

Support » How-To and Troubleshooting » upload size limit (contact form) although php.ini looks fine

upload size limit (contact form) although php.ini looks fine

  • wellenmacher
    Member

    @wellenmacher

    Hi,

    I’m using Contact Form 7 Plugin on several websites and there is an upload size limit of about 1.5M. Same thing on localhost. I checked my PHP.ini files an they look fine.

    – upload_max_filesize: 32M
    – post_max_size: 32M
    – max_execution_time: 360
    – memory_limit : 32M

    I found this thread: http://wordpress.org/support/topic/wp-limits-uploads-although-settings-in-phpini-state-otherwise and checked this function. the 3.6 version has a different function, but I’m not the expert and what I tried didnt work.

    wp-admin/includes/ms.php

    function check_upload_size( $file ) {
    	if ( get_site_option( 'upload_space_check_disabled' ) )
    		return $file;
    
    	if ( $file['error'] != '0' ) // there's already an error
    		return $file;
    
    	if ( defined( 'WP_IMPORTING' ) )
    		return $file;
    
    	$space_left = get_upload_space_available();
    
    	$file_size = filesize( $file['tmp_name'] );
    	if ( $space_left < $file_size )
    		$file['error'] = sprintf( __( 'Not enough space to upload. %1$s KB needed.' ), number_format( ($file_size - $space_left) /1024 ) );
    	if ( $file_size > ( 1024 * get_site_option( 'fileupload_maxk', 1500 ) ) )
    		$file['error'] = sprintf(__('This file is too big. Files must be less than %1$s KB in size.'), get_site_option( 'fileupload_maxk', 1500 ) );
    	if ( upload_is_user_over_quota( false ) ) {
    		$file['error'] = __( 'You have used your space quota. Please delete files before uploading.' );
    	}
    	if ( $file['error'] != '0' && !isset($_POST['html-upload']) )
    		wp_die( $file['error'] . ' <a href="history.go(-1)">' . __( 'Back' ) . '</a>' );
    
    	return $file;
    }

    Tried to play a bit with the numbers, but still same problem. Think, that has nothing to do with the frontend upload!?

    Can anyone help me with that?

    Best
    John

  • The topic ‘upload size limit (contact form) although php.ini looks fine’ is closed to new replies.