X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=admin%2Fattachments.php;h=bd567bf23684dfee55970b98789a274138135d92;hb=f821f29324e963437132a3f6fa7c57fcef5c5f0e;hp=4803ca771e00744abfeab67b1999db85882a1def;hpb=17b390efcf904072b02ec866b2a427490471a260;p=fa-stable.git diff --git a/admin/attachments.php b/admin/attachments.php index 4803ca77..bd567bf2 100644 --- a/admin/attachments.php +++ b/admin/attachments.php @@ -84,8 +84,14 @@ if ($Mode == 'ADD_ITEM' || $Mode == 'UPDATE_ITEM') { if (!transaction_exists($_POST['filterType'], $_POST['trans_no'])) display_error(_("Selected transaction does not exists.")); - elseif ($Mode == 'ADD_ITEM' && (!isset($_FILES['filename']) || $_FILES['filename']['size'] == 0)) + elseif ($Mode == 'ADD_ITEM' && !isset($_FILES['filename'])) display_error(_("Select attachment file.")); + elseif ($Mode == 'ADD_ITEM' && ($_FILES['filename']['error'] > 0)) { + if ($_FILES['filename']['error'] == UPLOAD_ERR_INI_SIZE) + display_error(_("The file size is over the maximum allowed.")); + else + display_error(_("Select attachment file.")); + } else { //$content = base64_encode(file_get_contents($_FILES['filename']['tmp_name'])); $tmpname = $_FILES['filename']['tmp_name'];