неделя, март 04, 2007

SquirrelMail max upload file size

Ето тук хората са си го обяснили много прилежно...

А ето и малко код от /usr/share/squirrelmail/src/compose.php (от ред 1194 е при мен)

/* This code is for attachments */
if ((bool) ini_get('file_uploads')) {

/* Calculate the max size for an uploaded file.
* This is advisory for the user because we can't actually prevent
* people to upload too large files. */
$sizes = array();
/* php.ini vars which influence the max for uploads */
$configvars = array('post_max_size', 'memory_limit', 'upload_max_filesize');
foreach($configvars as $var) {
/* skip 0 or empty values, and -1 which means 'unlimited' */
if( $size = getByteSize(ini_get($var)) ) {
if ( $size != '-1' ) {
$sizes[] = $size;
}
}
}

if(count($sizes) > 0) {
$maxsize = '(max. ' . show_readable_size( min( $sizes ) ) . ')' .
addHidden('MAX_FILE_SIZE', min( $sizes ));
} else {
$maxsize = '';

Create a new (empty) file in Windows

fsutil е готино тулче ...
fsutil file createnew 5.test 5242880 -- създава 5МВ празен файл