{
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'];
}
if (isset($_FILES['pic']) && $_FILES['pic']['name'] != '')
{
+ if ($_FILES['pic']['error'] == UPLOAD_ERR_INI_SIZE) {
+ display_error(_('The file size is over the maximum allowed.'));
+ $input_error = 1;
+ }
+ elseif ($_FILES['pic']['error'] > 0) {
+ display_error(_('Error uploading logo file.'));
+ $input_error = 1;
+ }
$result = $_FILES['pic']['error'];
$filename = company_path()."/images";
if (!file_exists($filename))
mkdir($filename);
}
$filename .= "/".item_img_name($stock_id).".jpg";
+
+ if ($_FILES['pic']['error'] == UPLOAD_ERR_INI_SIZE) {
+ display_error(_('The file size is over the maximum allowed.'));
+ $upload_file ='No';
+ }
+ elseif ($_FILES['pic']['error'] > 0) {
+ display_error(_('Error uploading file.'));
+ $upload_file ='No';
+ }
//But check for the worst
if ((list($width, $height, $type, $attr) = getimagesize($_FILES['pic']['tmp_name'])) !== false)