• Ok, so all my server settngs are correct to upload 20mb files, but how would i alter this part

    if ( ! is_uploaded_file( $file['tmp_name'] ) )
    		return $result;
    
    	$file_type_pattern = '';
    	$allowed_size = 20971520; // default size 20 MB
    
    	foreach ( $options as $option ) {
    		if ( preg_match( '%^filetypes:(.+)$%', $option, $matches ) ) {
    			$file_types = explode( '|', $matches[1] );
    			foreach ( $file_types as $file_type ) {
    				$file_type = trim( $file_type, '.' );
    				$file_type = str_replace(
    					array( '.', '+', '*', '?' ), array( '\.', '\+', '\*', '\?' ), $file_type );
    				$file_type_pattern .= '|' . $file_type;
    			}
    
    		} elseif ( preg_match( '/^limit:([1-9][0-9]*)([kKmM]?[bB])?$/', $option, $matches ) ) {
    			$allowed_size = (int) $matches[1];
    
    			$kbmb = strtolower( $matches[2] );
    			if ( 'kb' == $kbmb ) {
    				$allowed_size *= 1024;
    			} elseif ( 'mb' == $kbmb ) {
    				$allowed_size *= 1024 * 1024;
    			}
    
    		}
    	}

    I already changed the bytes under file size

    https://www.ads-software.com/extend/plugins/contact-form-7/

Viewing 9 replies - 1 through 9 (of 9 total)
  • following this thread. did you ever figure this out?

    Thread Starter KristyO

    (@kristyo)

    Nope.

    I’m in IPAGE hosting, and they are telling me on their hosting that no matter what they only offer 10mb uploads via script.

    I tried altering the php.ini, htaccess, and the script to the plugin with no success. Also thought it might be a problem with the SMTP send of the file b/c the error says it can’t send, not that it’s too big but i was not able to make that work either.

    I’m going to have to find another solution. ??

    bummer. where did you find the php.ini and htaccess files, and what did you alter with them? i’ve tried a bunch of other solutions suggested on other threads, but haven’t tried either of those methods you mentioned. thanks

    Thread Starter KristyO

    (@kristyo)

    I altered the php.ini file with these values

    post_max_size = 30M
    upload_max_filesize = 100M
    max_execution_time = 900
    memory_limit = 100M

    I tried to append the wp_config.php with

    define(‘WP_MEMORY_LIMIT’ , ‘100M’);

    – and –

    I tried this in the .htaccess

    <IfModule mod_php5.c>
    php_value post_max_size           30M
    php_value upload_max_filesize     100M
    php_value memory_limit            100M
    </IfModule

    No luck on any of it though.

    where exactly do you find the php.ini and .htaccess files? i’m a noob. thanks

    Thread Starter KristyO

    (@kristyo)

    .htaccess you might have to create or it should be in your root directory, or whatever directory your trying to affect. The php.ini file is also located in the root direcotory but it depends on your hosting to find where to change it.

    Look in your hosting control panel to see if there’s somewhere to alter scripts

    gotcha. thank you

    Thread Starter KristyO

    (@kristyo)

    Let me know if you get anything to work.

    i think my problem might lie within yahoo web hosting:

    Yahoo! does not currently allow you to upload .htaccess files to your account.

    ha! ah well. i know that the Simple Catch Pro version allows you to do this with ease within the admin… but that’s $20/year

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘[Plugin: Contact Form 7] Upload File Size’ is closed to new replies.