Upload Space Limitation for Network Setting & Pro Sites

Hi

I know there are few different settings for Upload Space where we can control them in Network Setting or via ProSites.

I just want to know more precisely on what are the best ways I can implement these: -

(1) Limit the Total Storage Space for Different User Groups
(2) Limit the Total Upload Space
(3) Limit the Upload Space for Individual File Size
(p/s: are total storage and total upload space the same thing, or actually are 2 different things)

Can I just do the above setting via Pro Sites and the Default Network Setting, or I need to integrated them with WHMCS.

And I would like to get more clearer picture for these:

(a) Upload Quota (ProSites) - "Allow you to give additional upload space to ProSites" - this is talking for Total upload space or per file size

(b) If we set the upload / storage space limitation via Pro Sites and the WP Default setting, where we can see the total usage per user?

Thanks in advance for any assistance.

Much Appreciated.

Sylvia

  • Vinod Dalvi

    Hi Sylvia,

    I hope you are well today and thank you for your question.

    (1) Limit the Total Storage Space for Different User Groups

    You can use pro sites levels as groups to limit it for different users.

    (2) Limit the Total Upload Space
    (p/s: are total storage and total upload space the same thing, or actually are 2 different things)

    It seems there are the same things. In pro sites plugin and network settings it is referred as upload space.

    (3) Limit the Upload Space for Individual File Size

    You can limit it in the Network Settings by setting the value for "Max upload file size" field displayed in the Upload Settings section.

    Can I just do the above setting via Pro Sites and the Default Network Setting, or I need to integrated them with WHMCS.

    You can achieve the above things without using WHMCS but you can also use our following WHMCS MU Provisioning plugin if you want o use its features.

    https://premium.wpmudev.org/project/whmcs-multisite-provisioning/

    (a) Upload Quota (ProSites) - "Allow you to give additional upload space to ProSites" - this is talking for Total upload space or per file size

    It's a total upload space.

    (b) If we set the upload / storage space limitation via Pro Sites and the WP Default setting, where we can see the total usage per user?

    You will find the information about the usage on the following path.

    Network Admin Area -> Pro Sites -> Statistics

    Kind Regards,
    Vinod Dalvi

  • Vinod Dalvi

    Hi Sylvia,

    You can restrict the Upload Space for Individual File Size and can limit total upload space for different user groups/levels as specified in my previous reply.

    I didn't find any pro sites option to restrict maximum size of an individual image file upload for different user group/level therefore i have notified the SLS developer to get his invaluable reply to know whether there is any work around to achieve it.

    The SLS developer will reply on this thread shortly.

    Cheers,
    Vinod Dalvi

  • Hoang Ngo

    Hi @Sylvia,

    I hope you are well today.

    Please add this code to your theme functions.php or use mu-plugins

    add_filter('wp_handle_upload_prefilter', 'prosite_validate_file_upload');
    function prosite_validate_file_upload($file)
    {
        global $psts;
        $plans_quote = array(
            0 => 5,
            1 => 10
        );
        if ($psts instanceof ProSites) {
            $level = $psts->get_level(get_current_blog_id());
            //get the quote
            if (isset($plans_quote[$level])) {
                $quote = $plans_quote[$level];
                //check the file
                $file_size = $file['size'];
                if (($quote * 1000000) < $file_size) {
                    //over limit
                    $file['error'] = __('Reach limit for this file type');
                }
            }
        }
        return $file;
    }

    The $plans_quote is contain the level_id=>maximum quote, the 0 is default, which will apply for non prosite.

    Please give it a try and let us update.

    Best regards,
    Hoang Ngo

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.