summaryrefslogtreecommitdiff
path: root/roundcubemail/program/steps/mail/compose.inc
diff options
context:
space:
mode:
authoralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2011-08-16 12:11:21 +0000
committeralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2011-08-16 12:11:21 +0000
commit9bee1c60a7f16d015c7fa01d4aeecb6c0362ee23 (patch)
tree1ee52d6bfd5be805e638a56d943b4a3a5c6d96d3 /roundcubemail/program/steps/mail/compose.inc
parent1edf2911b5d4f73dd1adae0f22b9122ad27fc218 (diff)
- Add client-side checking of uploaded files size
git-svn-id: https://svn.roundcube.net/trunk@5071 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/steps/mail/compose.inc')
-rw-r--r--roundcubemail/program/steps/mail/compose.inc17
1 files changed, 4 insertions, 13 deletions
diff --git a/roundcubemail/program/steps/mail/compose.inc b/roundcubemail/program/steps/mail/compose.inc
index 31de0d9ee..9a94ff742 100644
--- a/roundcubemail/program/steps/mail/compose.inc
+++ b/roundcubemail/program/steps/mail/compose.inc
@@ -1206,20 +1206,11 @@ function rcmail_compose_attachment_form($attrib)
if (!$attrib['id'])
$attrib['id'] = 'rcmUploadbox';
- // Enable upload progress bar
- rcube_upload_progress_init();
+ // Get filesize, enable upload progress bar
+ $max_filesize = rcube_upload_init();
- // 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;
-
- $OUTPUT->set_env('max_filesize', $max_filesize);
- $max_filesize = show_bytes($max_filesize);
-
$button = new html_inputfield(array('type' => 'button'));
-
+
$out = html::div($attrib,
$OUTPUT->form_tag(array('name' => 'uploadform', 'method' => 'post', 'enctype' => 'multipart/form-data'),
html::div(null, rcmail_compose_attachment_field(array('size' => $attrib['attachmentfieldsize']))) .
@@ -1230,7 +1221,7 @@ function rcmail_compose_attachment_form($attrib)
)
)
);
-
+
$OUTPUT->add_gui_object('uploadbox', $attrib['id']);
return $out;
}