diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php
index 00c1a3bf98e..c95f857a4a9 100644
--- a/htdocs/core/class/html.formfile.class.php
+++ b/htdocs/core/class/html.formfile.class.php
@@ -1437,7 +1437,7 @@ class FormFile
//var_dump($sortfield.' - '.$sortorder);
if ($sortfield && $sortorder) { // If $sortfield is for example 'position_name', we will sort on the property 'position_name' (that is concat of position+name)
- $filearray = dol_sort_array($filearray, $sortfield, $sortorder);
+ $filearray = dol_sort_array($filearray, $sortfield, $sortorder, 1);
}
}