Im creating a file upload function in node.js with express 3.
I would like to grab the file extension of the image. so i can rename the file and then append the file
You can use path.parse(path), for example
const path = require('path'); const { ext } = path.parse('/home/user/dir/file.txt');