$this->_options[$name] = $value;
}
}
- if (!empty($options['maxbytes'])) {
+ if (empty($options['maxbytes'])) {
$this->_options['maxbytes'] = get_max_upload_file_size($CFG->maxbytes, $options['maxbytes']);
}
parent::HTML_QuickForm_element($elementName, $elementLabel, $attributes);
$options = file_get_draft_area_files($draftitemid);
$options->mainfile = $this->_options['mainfile'];
- $options->maxbytes = $this->getMaxbytes();
+ $options->maxbytes = $this->_options['maxbytes'];
$options->maxfiles = $this->getMaxfiles();
$options->client_id = $client_id;
$options->filecount = $filecount;
params['sesskey']=M.cfg.sesskey;
params['client_id'] = args.client_id;
params['itemid'] = this.options.itemid?this.options.itemid:0;
+ params['maxbytes'] = this.options.maxbytes?this.options.maxbytes:-1;
if (args['params']) {
for (i in args['params']) {
params[i] = args['params'][i];
break;
case 'upload':
try {
- $result = $repo->upload();
+ $result = $repo->upload($maxbytes);
$result['client_id'] = $client_id;
echo json_encode($result);
} catch (Exception $e){