• Hi, I am looking for solutions to be able to change the Upload Max Limit per site on a Multisite Setup.

    This means that for Site1 Upload limit will be default at 2mb but for Site2 the Max Upload Limit would be 16mb?

    Currently you can only set the Max Upload Limit Globally but is there a plugin or options/hacks to do this to site level for individual settings?

    Thanks

Viewing 11 replies - 1 through 11 (of 11 total)
  • This means that for Site1 Upload limit will be default at 2mb but for Site2 the Max Upload Limit would be 16mb?

    — I’m a little confused, do you want to limit the size of each uploaded file:

    • example1.com can upload files 2MB in size or less
    • example2.com can upload files 5MB in size or less
    • example3.com can upload files 30MB in size or less

    or do you want to limit the total disk space a site can use:

    • example1.com can upload up to 20MB of files (could be tens or hundreds of files)
    • example2.com can upload up to 100MB of files (could be tens or hundreds of files)
    • example3.com can upload up to 250MB of files (could be tens or hundreds of files)
    Thread Starter Scholarty

    (@scholarty)

    Hi jkovis,

    I want to limited each upload.

    This example:

    example1.com can upload files 2MB in size or less
    example2.com can upload files 5MB in size or less
    example3.com can upload files 30MB in size or less

    Thank YOu

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    This is advanced, dangerous stuff. Do not edit these things recklessly, as you’re essentially making a direct DB edit

    Go to Network Admin -> Sites

    Hover over a site, click on edit.

    Click on the settings tab.

    Look for “Fileupload Maxk” and adjust.

    You can also edit “Blog Upload Space” if you need.

    Thread Starter Scholarty

    (@scholarty)

    Hi Ipsteni,

    So had a look and there is no “Fileupload Max” only the “Site Upload Space Quota” Can’t seem to edit this. Has this feature been taken out?

    Thanks

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    Hrm. it may be new in 4.0?

    There is a way to modify the “fileupload_maxk” value for each blog, but the example code below depends on hardcoding a blog id to limit array ($blog_upload_map). I’ll reiterate, but slightly tweak Ipsteni’s warning from above:

    This is advanced stuff. Do not edit these things recklessly and thoroughly test on a development install before applying to a live site

    function filter_fileupload_maxk( $maxk ) {
    	global $current_blog;
    
    	// the blog_upload_map data could also be stored as an option for each blog
    	$blog_upload_map = array(
    		1 => 2000,  // blog 1 can upload files 2MB in size or less
    		2 => 5000,  // blog 2 can upload files 5MB in size or less
    		3 => 30000 // blog 3 can upload files 30MB in size or less
    	);
    	if ( isset( $blog_upload_map[$current_blog->blog_id] ) && absint( $blog_upload_map[$current_blog->blog_id] ) ) {
    		$maxk = $blog_upload_map[$current_blog->blog_id];
    	}
    
    	return $maxk;
    }
    add_filter( 'pre_site_option_fileupload_maxk', 'filter_fileupload_maxk' );

    Most likely getting in way over my head, but where exactly, in what file, would I make that change?

    where exactly, in what file, would I make that change?

    — It would probably be easiest to create a new “must use” plugin (any php file inside wp-content/mu-plugins/ would work).

    I need this too for my network. Is hacking the code really the only way? My main site has articles and media files, and I want to be able to put bigger files there. I have a few sub sites that have directories for a niche market related to the main site. For those the subscribers can upload images, and I want to limit them to 150kb at most, maybe a little less.

    I’m constantly uploading things to the main blog. I try to do that under an editor login so that I never write a blog post as a superadmin. It would be a real pain to have to go into network settings every time I want to add a photo to a blog article.

    Excuse me I mean to say contributors not subscribers can upload pictures when they belong to the directory.

    There is a plugin Limit User Upload Quota that adds a setting under the Media menu.That might do what you require.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Multisite – Change Upload Max Limit Per Site’ is closed to new replies.