|
|
|
@ -291,6 +291,24 @@ class OC_FILES { |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* set the maximum upload size limit for apache hosts using .htaccess |
|
|
|
|
* @param int size filesisze in bytes |
|
|
|
|
*/ |
|
|
|
|
static function setUploadLimit($size){ |
|
|
|
|
global $SERVERROOT; |
|
|
|
|
global $WEBROOT; |
|
|
|
|
$size=OC_HELPER::humanFileSize($size); |
|
|
|
|
echo $size; |
|
|
|
|
$size=substr($size,0,-1);//strip the B |
|
|
|
|
$size=str_replace(' ','',$size); //remove the space between the size and the postfix |
|
|
|
|
$content = "ErrorDocument 404 /$WEBROOT/templates/404.php\n";//custom 404 error page |
|
|
|
|
$content.= "php_value upload_max_filesize $size\n";//upload limit |
|
|
|
|
$content.= "php_value post_max_size $size\n"; |
|
|
|
|
$content.= "SetEnv htaccessWorking true\n"; |
|
|
|
|
@file_put_contents($SERVERROOT.'/.htaccess', $content); //supress errors in case we don't have permissions for it |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function zipAddDir($dir,$zip,$internalDir=''){ |
|
|
|
|