Upload quota bug -> cant upload additional file, error dont apears

http://gyazo.com/40f7a0a8860a8435bd853897e8c0d177

Hi,

ive set the quota to 10 MB (see screenshot)

Problem is the error message only apears when its over 100%

but you cant upload a file when it would go over the quota -> http error apears.

there should be an option to display the message at 90% or to give 10% over usage…

for my frontend it works -> guests can upload one last file which can exeed the quota, then file uploads gets disabled…

just for the case anyone needs a similar function:

<?php

function upload_is_user_over_quota( $echo = true ) {
if ( get_site_option( 'upload_space_check_disabled' ) )
return false;

$space_allowed = get_space_allowed();
if ( empty( $space_allowed ) || !is_numeric( $space_allowed ) )
$space_allowed = 10; // Default space allowed is 10 MB

$space_used = get_space_used();

if ( ( $space_allowed - $space_used ) < -0 ) {

return true;
} else {
return false;
}
}

if (upload_is_user_over_quota() == "true" ) {echo "Fileattachements disabled.";} else {echo "<input type="file" name="attachment" id="attachment" />";};

?>