diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2009-09-05 07:47:07 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2009-09-05 07:47:07 +0000 |
| commit | 40bfe1f97897e11545b6446bc3fe96f8d38c4344 (patch) | |
| tree | f81d9f0335517dd93464676025a6d7130ee8f037 /roundcubemail/program/steps/mail/compose.inc | |
| parent | 494f69637c1dae02bbfbb36a6a1493405c579a9a (diff) | |
- Check 'post_max_size' for upload max filesize (#1486089)
git-svn-id: https://svn.roundcube.net/trunk@2926 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/steps/mail/compose.inc')
| -rw-r--r-- | roundcubemail/program/steps/mail/compose.inc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/roundcubemail/program/steps/mail/compose.inc b/roundcubemail/program/steps/mail/compose.inc index 79a95dbcf..5d1fe2122 100644 --- a/roundcubemail/program/steps/mail/compose.inc +++ b/roundcubemail/program/steps/mail/compose.inc @@ -823,13 +823,20 @@ function rcmail_compose_attachment_form($attrib) // add ID if not given if (!$attrib['id']) $attrib['id'] = 'rcmUploadbox'; + + // find max filesize value + $max_filesize = parse_bytes(ini_get('upload_max_filesize')); + $max_postsize = parse_bytes(ini_get('post_max_size')); + if ($max_postsize && $max_postsize < $max_filesize) + $max_filesize = $max_postsize; + $max_filesize = show_bytes($max_filesize); $button = new html_inputfield(array('type' => 'button', 'class' => 'button')); $out = html::div($attrib, $OUTPUT->form_tag(array('name' => 'form', 'method' => 'post', 'enctype' => 'multipart/form-data'), html::div(null, rcmail_compose_attachment_field(array())) . - html::div('hint', rcube_label(array('name' => 'maxuploadsize', 'vars' => array('size' => show_bytes(parse_bytes(ini_get('upload_max_filesize'))))))) . + html::div('hint', rcube_label(array('name' => 'maxuploadsize', 'vars' => array('size' => $max_filesize)))) . html::div('buttons', $button->show(rcube_label('close'), array('onclick' => "document.getElementById('$attrib[id]').style.visibility='hidden'")) . ' ' . $button->show(rcube_label('upload'), array('onclick' => JS_OBJECT_NAME . ".command('send-attachment', this.form)")) |
