diff --git a/htdocs/compta/accounting-files.php b/htdocs/compta/accounting-files.php
index af18b834edf..cb2c3d2fdff 100644
--- a/htdocs/compta/accounting-files.php
+++ b/htdocs/compta/accounting-files.php
@@ -16,11 +16,17 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-/**
+
+ /**
* \file htdocs/compta/accounting-files.php
* \ingroup compta
* \brief Page to show portoflio and files of a thirdparty and download it
*/
+
+if ($_GET['action'] == 'dl' || $_POST['action'] == 'dl') { // To not replace token when downloading file
+ if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1');
+}
+
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
@@ -106,7 +112,7 @@ $error = 0;
$filesarray = array();
$result = false;
-if (($action == "searchfiles" || $action == "dl")) {
+if (($action == 'searchfiles' || $action == 'dl')) {
if (empty($date_start))
{
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DateStart")), null, 'errors');
@@ -459,7 +465,7 @@ if (!empty($date_start) && !empty($date_stop))
$param .= '&date_stopyear='.GETPOST('date_stopyear', 'int');
print '