diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index f112cdc7e4e..8ba9351d053 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -2455,8 +2455,9 @@ class Ticket extends CommonObject // If destination file already exists, we add a suffix to avoid to overwrite if (is_file($destfile)) { - $now = dol_now(); - $destfile .= '.'.dol_print_date($now, 'dayhourlog'); + $pathinfo = pathinfo($filename[$i]); + $now = dol_now(); + $destfile = $destdir.'/'.$pathinfo['filename'].' - '.dol_print_date($now, 'dayhourlog').'.'.$pathinfo['extension']; } $res = dol_move($filepath[$i], $destfile, 0, 1);