13
Node.js 파일 확장명 가져 오기
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/' …