본문 바로가기
개발

nodeJS-TypeError: source.on is not a function

by deokkk 2022. 6. 15.
반응형

요약

- multer로 multipart/form-data File 업로드 시 발생하는 오류입니다.

 

Error

TypeError: source.on is not a function

 

Solution

- fs.createReadStream을 활용

const formData = new FormData();
formData.append('file', fs.createReadStream(${file.path}));

...
반응형

댓글