Example: c:/users/images/logo.png to logo.png c:\users\images\logo.png to logo.png
Asked
Active
Viewed 167 times
-3
-
2Does 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 Answers
0
var filename = fullPath.replace(/^.*[\\\/]/, '')
try above this may help to get file name from any path this will support / OR \ both

Ankit Dabhi
- 48
- 9
-
This is an **obvious** duplicate question. Please don't post answers to obvious duplicates. – T.J. Crowder Jan 22 '22 at 14:53