13
Node.js getファイル拡張子
Express 3を使用してnode.jsでファイルアップロード関数を作成しています。 画像のファイル拡張子を取得したいと思います。ファイルの名前を変更して、ファイル拡張子を追加できます。 app.post('/upload', function(req, res, next) { var is = fs.createReadStream(req.files.upload.path), fileExt = '', // I want to get the extension of the image here os = fs.createWriteStream('public/images/users/' + req.session.adress + '.' + fileExt); }); node.jsで画像の拡張子を取得するにはどうすればよいですか?