Skip to content

Commit

Permalink
Fixed issue #9498: Error message when try to import a big LSA file ca…
Browse files Browse the repository at this point in the history
…n be an error

Dev Partial fix - Proper error message when uploading a label set, that is too big.
  • Loading branch information
c-schmitz committed Jun 5, 2016
1 parent af24ba7 commit 027e139
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions application/controllers/admin/labels.php
Expand Up @@ -136,6 +136,11 @@ public function import()
$aPathInfo = pathinfo($_FILES['the_file']['name']);
$sExtension = !empty($aPathInfo['extension']) ? $aPathInfo['extension'] : '';

if ($_FILES['the_file']['error']==1 || $_FILES['the_file']['error']==2)
{
$this->getController()->error(sprintf(gT("Sorry, this file is too large. Only files up to %01.2f MB are allowed."), getMaximumFileUploadSize()/1024/1024));
}

if (!@move_uploaded_file($_FILES['the_file']['tmp_name'], $sFullFilepath))
$this->getController()->error(sprintf(gT("An error occurred uploading your file. This may be caused by incorrect permissions in your %s folder."), Yii::app()->getConfig('tempdir')));

Expand Down

0 comments on commit 027e139

Please sign in to comment.