https://git.oschina.net/xiaoxiehang/photoWall.git ? 這個(gè)是我照著老師的例子做的一個(gè)DEMO?還有我想在demo上增加一個(gè)上傳本地圖片的功能,還是不知道如何做。沒有一點(diǎn)nodejs基礎(chǔ),demo 中還有很多地方不是太明白。。。。。app.use(bodyParser.json());app.use(bodyParser.urlencoded({ extended: true }));//這兩句的意思一直沒明白。。。var id = req.params.id;var imgObj = req.body.img;var id = imgObj._id;var id = req.query.id;這些分別是什么意思。。。我在網(wǎng)上找了一個(gè)上傳圖片的例子 ,里面有這么一句:app.post('/admin/upload/new',function(req, res){? ? ? ? //獲取臨時(shí)文件的路徑? ? ? ? var tmpPath = req.files.thumbnail.path;????????.............})這里會(huì)報(bào)錯(cuò)TypeError: Cannot read property 'path' of undefined? ?at F:\photoWall\routes\index.js:103:42? ?at Layer.handle [as handle_request] (F:\photoWall\node_modules\express\lib\router\layer.js:82:5)? ?at next (F:\photoWall\node_modules\express\lib\router\route.js:110:13)? ?at Route.dispatch (F:\photoWall\node_modules\express\lib\router\route.js:91:3)? ?at Layer.handle [as handle_request] (F:\photoWall\node_modules\express\lib\router\layer.js:82:5)? ?at F:\photoWall\node_modules\express\lib\router\index.js:267:22? ?at Function.proto.process_params (F:\photoWall\node_modules\express\lib\router\index.js:321:12)? ?at next (F:\photoWall\node_modules\express\lib\router\index.js:261:10)? ?at serveStatic (F:\photoWall\node_modules\express\node_modules\serve-static\index.js:59:14)? ?at Layer.handle [as handle_request] (F:\photoWall\node_modules\express\lib\router\layer.js:82:5)求大神來解答,跪謝
- 0 回答
- 1 關(guān)注
- 1616 瀏覽
添加回答
舉報(bào)
0/150
提交
取消