diff --git a/download_attachment.php b/download_attachment.php index e3ffe949..59ec5758 100755 --- a/download_attachment.php +++ b/download_attachment.php @@ -127,7 +127,12 @@ if (isset($_GET['kb_att'])) { // Perhaps the file has been deleted? if (!file_exists($realpath)) { - hesk_error($hesklang['attdel']); + // Let's try the ticket attachment folder. Legacy KB attachments are not automatically migrated. + $realpath = $hesk_settings['attach_dir'] . '/' . $file['saved_name']; + + if (!file_exists($realpath)) { + hesk_error($hesklang['attdel']); + } } // Update the download count @@ -161,5 +166,4 @@ if ($file['size'] > $chunksize) { readfile($realpath); } -exit(); -?> +exit(); \ No newline at end of file