Skip to main content
replaced http://wordpress.stackexchange.com/ with https://wordpress.stackexchange.com/
Source Link

I'm working on a multisite WP installation and I need to import content from other Wordpress sites (.wxr files). When I use the Import WordPress plugin I got the following:

enter image description here

The maximum allowed upload size is only 1MB, while I set 100MB in my php.ini. A call to phpinfo() tells that the .ini values should apply:

enter image description here

What is wrong there? I read through most of the search results for upload_max_filesize on this siteupload_max_filesize on this site, but none works.

Note: This only happens with Wordpress. I have Symfony2 sites and I can upload files with 100MB size and more - so yes, it's the right php.ini settings and the Apache server properly applies them.

Writing MU Wordpress Plugin

After @kaiser suggestion I've created a /wp-content/mu-plugins/uploadSizeLimit.php file and wrote this on it:

/** Plugin Name: (WPSE) #177620 Alter Upload Size Limit */
add_filter(
    'upload_size_limit',
    function ( $limit = 0, $u_bytes = 0, $p_bytes = 0 ) {
        return 
               current_user_can( 'manage_options' ) 
               ? 1024 * 1024 * 10 // Divert by 1024 to get the value in kB
               : $limit;
    }
);

How do I use this to achieve what I need?

I'm working on a multisite WP installation and I need to import content from other Wordpress sites (.wxr files). When I use the Import WordPress plugin I got the following:

enter image description here

The maximum allowed upload size is only 1MB, while I set 100MB in my php.ini. A call to phpinfo() tells that the .ini values should apply:

enter image description here

What is wrong there? I read through most of the search results for upload_max_filesize on this site, but none works.

Note: This only happens with Wordpress. I have Symfony2 sites and I can upload files with 100MB size and more - so yes, it's the right php.ini settings and the Apache server properly applies them.

Writing MU Wordpress Plugin

After @kaiser suggestion I've created a /wp-content/mu-plugins/uploadSizeLimit.php file and wrote this on it:

/** Plugin Name: (WPSE) #177620 Alter Upload Size Limit */
add_filter(
    'upload_size_limit',
    function ( $limit = 0, $u_bytes = 0, $p_bytes = 0 ) {
        return 
               current_user_can( 'manage_options' ) 
               ? 1024 * 1024 * 10 // Divert by 1024 to get the value in kB
               : $limit;
    }
);

How do I use this to achieve what I need?

I'm working on a multisite WP installation and I need to import content from other Wordpress sites (.wxr files). When I use the Import WordPress plugin I got the following:

enter image description here

The maximum allowed upload size is only 1MB, while I set 100MB in my php.ini. A call to phpinfo() tells that the .ini values should apply:

enter image description here

What is wrong there? I read through most of the search results for upload_max_filesize on this site, but none works.

Note: This only happens with Wordpress. I have Symfony2 sites and I can upload files with 100MB size and more - so yes, it's the right php.ini settings and the Apache server properly applies them.

Writing MU Wordpress Plugin

After @kaiser suggestion I've created a /wp-content/mu-plugins/uploadSizeLimit.php file and wrote this on it:

/** Plugin Name: (WPSE) #177620 Alter Upload Size Limit */
add_filter(
    'upload_size_limit',
    function ( $limit = 0, $u_bytes = 0, $p_bytes = 0 ) {
        return 
               current_user_can( 'manage_options' ) 
               ? 1024 * 1024 * 10 // Divert by 1024 to get the value in kB
               : $limit;
    }
);

How do I use this to achieve what I need?

deleted 406 characters in body
Source Link
ReynierPM
  • 537
  • 3
  • 12
  • 26

I'm working on a multisite WP installation and I need to import content from other Wordpress sites (.wxr files). When I use the Import WordPress plugin I got the following:

enter image description here

The maximum allowed upload size is only 1MB, while I set 100MB in my php.ini. A call to phpinfo() tells that the .ini values should apply:

enter image description here

What is wrong there? I read through most of the search results for upload_max_filesize on this site, but none works.

Note: This only happens with Wordpress. I have Symfony2 sites and I can upload files with 100MB size and more - so yes, it's the right php.ini settings and the Apache server properly applies them.

Writing MU Wordpress Plugin

After @kaiser suggestion I've created a /wp-content/mu-plugins/uploadSizeLimit.php file and wrote this on it:

<?php

/**
 * @package Upload Size Limit
 * @version 1.0
 */
/*
Plugin Name: Upload Size Limit
Description: Filter to change the value for upload size limit
Author: ReynierPM
Version: 1.0
*/

/** Plugin Name: (WPSE) #177620 Alter Upload Size Limit */
add_filter(
    'upload_size_limit',
    function ( $limit = 0, $u_bytes = 0, $p_bytes = 0 ) {
        return (
        in_array( get_current_screen()->base,      current_user_can( 'manage_options' ) )
               ? 1024 * 1024 * 10 // Divert by 1024 to get the value in kB
            : $limit
       : );$limit;
    }
);

How do I use this to achieve what I need?

I'm working on a multisite WP installation and I need to import content from other Wordpress sites (.wxr files). When I use the Import WordPress plugin I got the following:

enter image description here

The maximum allowed upload size is only 1MB, while I set 100MB in my php.ini. A call to phpinfo() tells that the .ini values should apply:

enter image description here

What is wrong there? I read through most of the search results for upload_max_filesize on this site, but none works.

Note: This only happens with Wordpress. I have Symfony2 sites and I can upload files with 100MB size and more - so yes, it's the right php.ini settings and the Apache server properly applies them.

Writing MU Wordpress Plugin

After @kaiser suggestion I've created a /wp-content/mu-plugins/uploadSizeLimit.php file and wrote this on it:

<?php

/**
 * @package Upload Size Limit
 * @version 1.0
 */
/*
Plugin Name: Upload Size Limit
Description: Filter to change the value for upload size limit
Author: ReynierPM
Version: 1.0
*/

/** Plugin Name: (WPSE) #177620 Alter Upload Size Limit */
add_filter(
    'upload_size_limit',
    function ( $limit = 0, $u_bytes = 0, $p_bytes = 0 ) {
        return (
        in_array( get_current_screen()->base, current_user_can( 'manage_options' ) )
            ? 1024 * 1024 * 10 // Divert by 1024 to get the value in kB
            : $limit
        );
    }
);

How do I use this to achieve what I need?

I'm working on a multisite WP installation and I need to import content from other Wordpress sites (.wxr files). When I use the Import WordPress plugin I got the following:

enter image description here

The maximum allowed upload size is only 1MB, while I set 100MB in my php.ini. A call to phpinfo() tells that the .ini values should apply:

enter image description here

What is wrong there? I read through most of the search results for upload_max_filesize on this site, but none works.

Note: This only happens with Wordpress. I have Symfony2 sites and I can upload files with 100MB size and more - so yes, it's the right php.ini settings and the Apache server properly applies them.

Writing MU Wordpress Plugin

After @kaiser suggestion I've created a /wp-content/mu-plugins/uploadSizeLimit.php file and wrote this on it:

/** Plugin Name: (WPSE) #177620 Alter Upload Size Limit */
add_filter(
    'upload_size_limit',
    function ( $limit = 0, $u_bytes = 0, $p_bytes = 0 ) {
        return 
               current_user_can( 'manage_options' ) 
               ? 1024 * 1024 * 10 // Divert by 1024 to get the value in kB
               : $limit;
    }
);

How do I use this to achieve what I need?

added 882 characters in body
Source Link
ReynierPM
  • 537
  • 3
  • 12
  • 26

I'm working on a multisite WP installation and I need to import content from other Wordpress sites (.wxr files). When I use the Import WordPress plugin I got the following:

enter image description here

The maximum allowed upload size is only 1MB, while I set 100MB in my php.ini. A call to phpinfo() tells that the .ini values should apply:

enter image description here

What is wrong there? I read through most of the search results for upload_max_filesize on this site, but none works.

Note: This only happens with Wordpress. I have Symfony2 sites and I can upload files with 100MB size and more - so yes, it's the right php.ini settings and the Apache server properly applies them.

Writing MU Wordpress Plugin

After @kaiser suggestion I've created a /wp-content/mu-plugins/uploadSizeLimit.php file and wrote this on it:

<?php

/**
 * @package Upload Size Limit
 * @version 1.0
 */
/*
Plugin Name: Upload Size Limit
Description: Filter to change the value for upload size limit
Author: ReynierPM
Version: 1.0
*/

/** Plugin Name: (WPSE) #177620 Alter Upload Size Limit */
add_filter(
    'upload_size_limit',
    function ( $limit = 0, $u_bytes = 0, $p_bytes = 0 ) {
        return (
        in_array( get_current_screen()->base, current_user_can( 'manage_options' ) )
            ? 1024 * 1024 * 10 // Divert by 1024 to get the value in kB
            : $limit
        );
    }
);

How do I use this to achieve what I need?

I'm working on a multisite WP installation and I need to import content from other Wordpress sites (.wxr files). When I use the Import WordPress plugin I got the following:

enter image description here

The maximum allowed upload size is only 1MB, while I set 100MB in my php.ini. A call to phpinfo() tells that the .ini values should apply:

enter image description here

What is wrong there? I read through most of the search results for upload_max_filesize on this site, but none works.

Note: This only happens with Wordpress. I have Symfony2 sites and I can upload files with 100MB size and more - so yes, it's the right php.ini settings and the Apache server properly applies them.

I'm working on a multisite WP installation and I need to import content from other Wordpress sites (.wxr files). When I use the Import WordPress plugin I got the following:

enter image description here

The maximum allowed upload size is only 1MB, while I set 100MB in my php.ini. A call to phpinfo() tells that the .ini values should apply:

enter image description here

What is wrong there? I read through most of the search results for upload_max_filesize on this site, but none works.

Note: This only happens with Wordpress. I have Symfony2 sites and I can upload files with 100MB size and more - so yes, it's the right php.ini settings and the Apache server properly applies them.

Writing MU Wordpress Plugin

After @kaiser suggestion I've created a /wp-content/mu-plugins/uploadSizeLimit.php file and wrote this on it:

<?php

/**
 * @package Upload Size Limit
 * @version 1.0
 */
/*
Plugin Name: Upload Size Limit
Description: Filter to change the value for upload size limit
Author: ReynierPM
Version: 1.0
*/

/** Plugin Name: (WPSE) #177620 Alter Upload Size Limit */
add_filter(
    'upload_size_limit',
    function ( $limit = 0, $u_bytes = 0, $p_bytes = 0 ) {
        return (
        in_array( get_current_screen()->base, current_user_can( 'manage_options' ) )
            ? 1024 * 1024 * 10 // Divert by 1024 to get the value in kB
            : $limit
        );
    }
);

How do I use this to achieve what I need?

added 162 characters in body; edited title
Source Link
kaiser
  • 50.8k
  • 27
  • 150
  • 244
Loading
Source Link
ReynierPM
  • 537
  • 3
  • 12
  • 26
Loading