简体   繁体   English

如何使用react上传图像并将其保存到数据库

[英]how to upload the images and save it to database using react

I am designing profile page for my site using MERN stack. 我正在使用MERN堆栈设计网站的个人资料页面。 Now my question is how do I upload the image from local machine and save it to the database and also displaying it in the profile page 现在我的问题是如何从本地计算机上载图像并将其保存到数据库中并在配置文件页面中显示它

Use multer for images upload. 使用multer上传图片。 Check out this article for code examples. 查看本文以获得代码示例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何通过将图像存储到数据库中来在 React js 中上传和显示图像 - How to upload and display images in react js by storing them into a database 使用 React 将图像上传到 firestore - upload images to firestore using react 如何使用 React、fetch 和 Django REST 上传图像 - How to Upload Images using React, fetch, and Django REST 如何使用PHP一次将多组图像上传到数据库 - How to upload a multiple set of images to database at once using php 如何使用 mean.js 上传图像并将其保存到数据库(猫鼬) - How to upload an image and save it to database(mongoose) using mean.js 卸载组件后,React文件上传组件的图像应保存在哪里? - Where to save images of React file upload component after component will unmount? 如何使用Firebase Realtime数据库和React Native上传图像/文件? - How to upload an image / file using Firebase Realtime database and React Native? 如何使用 React Native 将图像上传到 Web 服务器 - How to upload Images to a Webserver with React Native 如何在本地保存图像并使用另一个 PHP function 批量上传它们? - How can I locally save images and batch upload them using another PHP function? 如何在反应中缓存/保存图像并显示它们? - How to cache / save images in react and display them?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM