diff options
Diffstat (limited to 'web/react/utils')
-rw-r--r-- | web/react/utils/utils.jsx | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx index d1513dea9..09240bf06 100644 --- a/web/react/utils/utils.jsx +++ b/web/react/utils/utils.jsx @@ -907,3 +907,9 @@ module.exports.getFileUrl = function(filename) { return url; }; + +// Gets the name of a file (including extension) from a given url or file path. +module.exports.getFileName = function(path) { + var split = path.split('/'); + return split[split.length - 1]; +}; |