$page_security = 'SA_ITEM';
$path_to_root = "../..";
include($path_to_root . "/includes/session.inc");
+include($path_to_root . "/reporting/includes/tcpdf.php");
$js = "";
if ($SysPrefs->use_popup_windows)
{
mkdir($filename);
}
- $filename .= "/".item_img_name($stock_id).".jpg";
+ $filename .= "/".item_img_name($stock_id).(substr(trim($_FILES['pic']['name']), strrpos($_FILES['pic']['name'], '.')));
if ($_FILES['pic']['error'] == UPLOAD_ERR_INI_SIZE) {
display_error(_('The file size is over the maximum allowed.'));
if ($upload_file == 'Yes')
{
$result = move_uploaded_file($_FILES['pic']['tmp_name'], $filename);
+ if ($msg = check_image_file($filename)) {
+ display_error($msg);
+ unlink($filename);
+ $upload_file ='No';
+ }
}
$Ajax->activate('details');
/* EOF Add Image upload for New Item - by Ori */