Javascript: Get filename and path from full path filename

PHOTO EMBED

Mon Aug 29 2022 16:57:02 GMT+0000 (Coordinated Universal Time)

Saved by @marcopinero #javascript

function getFilename(fullname){
    return fullname.replace(/^.*[\\\/]/, '');
}

function getFilepath(fullname){
    var fn = fullname.split('/');
    fn.pop();
    return fn.join("/");
}

content_copyCOPY