node.js 上传和存储图像

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10192452/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-02 15:33:39  来源:igfitidea点击:

Uploading and storing images

node.jsmongodbexpressmongoose

提问by holyredbeard

Yes, I know about Uploading images using Node.js, Express, and Mongooseand How can I store images in mongodb with node.js?but the solution to those isn't what I want to achieve. I want to be able to use a Schema for the image to be stored in binary the db (Mongodb with Mongoose).

是的,我知道使用 Node.js、Express 和 Mongoose 上传图像以及如何使用 node.js 在 mongodb 中存储图像?但这些的解决方案不是我想要实现的。我希望能够使用架构将图像存储在二进制数据库中(Mongodb with Mongoose)。

So, do you know of any applications that uses the combo Node.js, Express and Mongodb? The best would be if there were any applications with this combo + Jade, but I guess that's to much to ask for.

那么,您知道使用 Node.js、Express 和 Mongodb 组合的任何应用程序吗?最好是如果有任何应用程序可以使用此组合 + Jade,但我想这要求太多了。

Thanks in advance!

提前致谢!

回答by aaronheckmann

Here's an quick exampleof storing/displaying an img with mongodb using node/express/mongoose.

这是使用 node/express/mongoose 使用 mongodb 存储/显示 img的快速示例