https://git.oschina.net/xiaoxiehang/photoWall.git 这个是我照着老师的例子做的一个DEMO 还有我想在demo上增加一个上传本地图片的功能,还是不知道如何做。没有一点nodejs基础,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;这些分别是什么意思。。。我在网上找了一个上传图片的例子 ,里面有这么一句:app.post('/admin/upload/new',function(req, res){ //获取临时文件的路径 var tmpPath = req.files.thumbnail.path; .............})这里会报错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 关注
- 1573 浏览
添加回答
举报
0/150
提交
取消