-3

Example: c:/users/images/logo.png to logo.png c:\users\images\logo.png to logo.png

  • 2
    Does this answer your question? [Regex for extracting filename from path](https://stackoverflow.com/questions/9363145/regex-for-extracting-filename-from-path) – Ba2sik Jan 22 '22 at 14:52

1 Answers1

0
var filename = fullPath.replace(/^.*[\\\/]/, '')

try above this may help to get file name from any path this will support / OR \ both