server/api/upload.js
// append a string to a filename, return the new filename
append a string to a filename, return the new filename
append a string to a filename return the new filename
function appendToFilename(filename, string){
    var dotIndex = filename.lastIndexOf(".");
    if (dotIndex == -1) return filename + string;
    else return filename.substring(0, dotIndex) + string + filename.substring(dotIndex);
}
function appendToFilename ( filename , string ) { var dotIndex = filename . lastIndexOf ( "." ) ; if ( dotIndex == - 1 ) return filename + string ; else return filename . substring ( 0 , dotIndex ) + string + filename . substring ( dotIndex ) ; }
append a string to a filename, return the new filename
append a string to a filename return the new filename