diff --git a/htdocs/ecm/index.php b/htdocs/ecm/index.php
index fd9169448ee..197c7e88ebd 100644
--- a/htdocs/ecm/index.php
+++ b/htdocs/ecm/index.php
@@ -591,7 +591,7 @@ $filearray=dol_dir_list($upload_dir,"files",0,'','\.meta$',$sortfield,(strtolowe
$formfile=new FormFile($db);
$param='§ion='.$section;
$textifempty=($section?$langs->trans("NoFileFound"):$langs->trans("ECMSelectASection"));
-$formfile->list_of_documents($filearray,'','ecm',$param,1,$relativepath,$user->rights->ecm->upload,1,$textifempty);
+$formfile->list_of_documents($filearray,'','ecm',$param,1,$relativepath,$user->rights->ecm->upload,1,$textifempty,40);
// print '
';
diff --git a/htdocs/html.formfile.class.php b/htdocs/html.formfile.class.php
index 650ebe4e3c3..ea3deb5f48a 100644
--- a/htdocs/html.formfile.class.php
+++ b/htdocs/html.formfile.class.php
@@ -421,7 +421,7 @@ class FormFile
* \param textifempty Text to show if filearray is empty
* \return int <0 if KO, nb of files shown if OK
*/
- function list_of_documents($filearray,$object,$modulepart,$param,$forcedownload=0,$relativepath='',$permtodelete=1,$useinecm=0,$textifempty='')
+ function list_of_documents($filearray,$object,$modulepart,$param,$forcedownload=0,$relativepath='',$permtodelete=1,$useinecm=0,$textifempty='',$maxlength=0)
{
global $user, $conf, $langs;
global $bc;
@@ -461,7 +461,7 @@ class FormFile
if ($forcedownload) print '&type=application/binary';
print '&file='.urlencode($relativepath.$file['name']).'">';
print img_mime($file['name']).' ';
- print $file['name'];
+ print dol_trunc($file['name'],$maxlength,'middle');
print '';
print "\n";
print '| '.dol_print_size($file['size']).' | ';