有没有前后端都有的可以提供图片上传的项目?比较着急需要,没时间一步一步自己做了,原谅我做次伸手党。
前端是angular 后端是 nodejs SqlScript 里有数据库角本。 配置数据库在 里面有图片上传功能。nodejs用的是 formidable 来接收上传的文件信息。 可以看看这个项目 https://github.com/xiaotuni/angular-map-http2
希望能帮到你。
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> <title>图片上传</title> <script src="http://cdn.bootcss.com/jquery/2.0.0/jquery.min.js"></script> </head> <body> <form action="/upload/upLoadDoc?name=1" method="post" enctype="multipart/form-data"> <input type="file" name="file"/> <input type="text" value="1212" name="class" > <input type="submit" value="ok"/> </form> </body> </html>
// var multer=require('multer'); const multer = require('koa-multer'); var storage = multer.diskStorage({ destination: function (req, file, cb) { cb(null, __dirname+ 'uploads/') }, filename: function (req, file, cb) { cb(null, file.originalname) } }) //添加配置文件到muler对象。 var upload = multer({ dest: 'uploads/' }); //var upload = multer({ storage: storage }); //如需其他设置,请参考multer的limits,使用方法如下。 //var upload = multer({ // storage: storage, // limits:{} // }); //导出对象 function mu(){ } module.exports = upload; ````
https://github.com/FantasyGao/About_Node/tree/master/upload 用busboy模块做的
CNode 社区为国内最专业的 Node.js 开源技术社区,致力于 Node.js 的技术研究。
前端是angular 后端是 nodejs SqlScript 里有数据库角本。 配置数据库在 里面有图片上传功能。nodejs用的是 formidable 来接收上传的文件信息。 可以看看这个项目 https://github.com/xiaotuni/angular-map-http2
希望能帮到你。
https://github.com/FantasyGao/About_Node/tree/master/upload 用busboy模块做的