Adapted system feedback when uploading too large documents

. Added clientside check to avoid uploads > max upload size on serverside
. Adapted message returned by server, when max upload size is exceeded
This commit is contained in:
Cris
2022-02-23 12:30:08 +01:00
parent 78d863a383
commit c8f93cae07
4 changed files with 66 additions and 3 deletions
@@ -119,7 +119,7 @@ class requestAnrechnung extends Auth_Controller
// Validate data
if (empty($_FILES['uploadfile']['name']))
{
return $this->outputJsonError($this->p->t('ui', 'errorUploadFehlt'));
return $this->outputJsonError($this->p->t('ui', 'errorUploadFehltOderZuGross'));
}
if (isEmptyString($begruendung_id) ||
@@ -26,7 +26,8 @@ $this->load->view(
'neu',
'maxZeichen',
'errorBestaetigungFehlt',
'systemfehler'
'systemfehler',
'errorDokumentZuGross'
),
'anrechnung' => array(
'deadlineUeberschritten',
@@ -179,7 +180,7 @@ $this->load->view(
<div class="form-inline panel-body">
<div class="form-group">
<input type="file" id="requestAnrechnung-uploadfile"
name="uploadfile" accept=".pdf" size="50"
name="uploadfile" accept=".pdf" size="50" data-maxsize="<?php echo (int)ini_get('upload_max_filesize') * 1024 ?>"
required>
</div>
<span id="requestAnrechnung-uploadTooltip" data-toggle="tooltip" data-placement="right"