diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php
index 591fb5ed2d1..a21ef8e3305 100644
--- a/htdocs/core/class/html.formfile.class.php
+++ b/htdocs/core/class/html.formfile.class.php
@@ -391,6 +391,20 @@ class FormFile
global $langs, $conf, $user, $hookmanager;
global $form;
+ $reshook = 0;
+ if (is_object($hookmanager)){
+ $parameters = array();
++ $reshook = $hookmanager->executeHooks('showdocuments', $parameters, $object);
+ // May report error
+ if ($reshook < 0) {
+ setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
+ }
+ }
+ // Remode default action if $reskook > 0
+ if ($reshook > 0) {
+ return '';
+ }
+
if (!is_object($form)) {
$form = new Form($this->db);
}