diff --git a/lib/models/FileRef.php b/lib/models/FileRef.php
index d367321ab9021959ff33ab1d223f94e5a44b6ede..c3804f8f92e680cfb399373dbc3dd43e16a65eb8 100644
--- a/lib/models/FileRef.php
+++ b/lib/models/FileRef.php
@@ -143,7 +143,7 @@ class FileRef extends SimpleORMap implements PrivacyObject, FeedbackRange
         $link = [];
         $params = [];
         $type = '0';
-        $file_name = $this->name;
+        $file_name = $this->file->name;
         $file_id = $this->id;
 
         switch($mode) {