diff --git a/app/src/components/FilePreview.js b/app/src/components/FilePreview.js index bb33f54b..9c865d93 100644 --- a/app/src/components/FilePreview.js +++ b/app/src/components/FilePreview.js @@ -36,9 +36,10 @@ function getIframeModal(path) { function getImageModal(path) { const url = getMediaPathURL(path); + const name = path['path'].replace(/^.*[\\\/]/, ''); return - {path['path']} + {name} @@ -63,10 +64,11 @@ function getEpubModal(path) { function getVideoModal(path) { const url = getMediaPathURL(path); + const name = path['path'].replace(/^.*[\\\/]/, ''); const type = path['mimetype'] ? path['mimetype'] : 'video/mp4'; return - {path['path']} + {name} {path['path']} @@ -84,10 +86,11 @@ function getVideoModal(path) { function getAudioModal(path) { const url = getMediaPathURL(path); + const name = path['path'].replace(/^.*[\\\/]/, ''); const type = path['mimetype'] !== 'application/octet-stream' ? path['mimetype'] : 'audio/mpeg'; return - {path['path']} + {name}