작성
·
314
0
[0] MongoDB Connected...
[0] C:\Users\User\Desktop\boilerplate-mern-stack-master\server\routes\product.js:28
[0] return res.json({success:true, filePath:res.req.file.path, fileName: res.req.file.filename})
[0] ^
[0]
[0] TypeError: Cannot read property 'path' of undefined
[0] at C:\Users\User\Desktop\boilerplate-mern-stack-master\server\routes\product.js:28:60
[0] at Array.<anonymous> (C:\Users\User\Desktop\node_modules\multer\lib\make-middleware.js:53:37)
[0] at listener (C:\Users\User\Desktop\node_modules\on-finished\index.js:169:15)
[0] at onFinish (C:\Users\User\Desktop\node_modules\on-finished\index.js:100:5)
[0] at callback (C:\Users\User\Desktop\node_modules\ee-first\index.js:55:10)
[0] at IncomingMessage.onevent (C:\Users\User\Desktop\node_modules\ee-first\index.js:93:5)
[0] at IncomingMessage.emit (events.js:412:35)
[0] at endReadableNT (internal/streams/readable.js:1317:12)
[0] at processTicksAndRejections (internal/process/task_queues.js:82:21)
[1] [HPM] Error occurred while trying to proxy request /api/product/image from localhost:3000 to http://localhost:5000 (ECONNRESET) (https://nodejs.org/api/errors.html#errors_common_system_errors)
[0] [nodemon] app crashed - waiting for file changes before starting...
[1] [HPM] Error occurred while trying to proxy request /api/product/image from localhost:3000 to http://localhost:5000 (ECONNREFUSED) (https://nodejs.org/api/errors.html#errors_common_system_errors)
답변 1
0
안녕하세요
이미지가 업로드 폴더에 잘 들어갔는지 먼저 확인해주실래요?
업로드를 한 후 그 경로가
일로 들어가는데 아마 업로드가 잘못되서 여기에 경로가 안들어가서 그런것 같습니다.
안녕하세요!
이부분 말씀하시는거죠?

routes/product파일로 가는게 아닌가요?