function getName(fileId, isFile){
    var splitted = fileId.split('/'); // get filename
    var filename = splitted[splitted.length - 1]; // get file name
    if(!isFile) return filename;
    
    filename = filename.split('.');
    if(filename.length === 1) return filename[0]; // file has no extension
    filename.pop(); // remove extension if it has one
    return filename.join('.');
}
function getName(fileId, isFile){
    var splitted = fileId.split('/'); 
    var filename = splitted[splitted.length - 1]; 
    if(!isFile) return filename;
    
    filename = filename.split('.');
    if(filename.length === 1) return filename[0]; 
    filename.pop(); 
    return filename.join('.');
}
function getName ( fileId , isFile ) { var splitted = fileId . split ( '/' ) ; // get filename var filename = splitted [ splitted . length - 1 ] ; // get file name if ( ! isFile ) return filename ; filename = filename . split ( '.' ) ; if ( filename . length === 1 ) return filename [ 0 ] ; // file has no extension filename . pop ( ) ; // remove extension if it has one return filename . join ( '.' ) ; }
helper - extract name from fileId
@param {String} fileId
@param {Boolean} isFile
@returns {String}  file name
helper - extract name from fileId