E
E
ExcaliBUR952022-04-15 13:18:50
MongoDB
ExcaliBUR95, 2022-04-15 13:18:50

Need to upload photos to the server (mongoose), via React, redux, react-redux?

Can someone explain, upload a video or material on how to upload
Images, files, drag and drop with React + mongoose + redux front + back, or at least just select and upload

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
wonderingpeanut, 2022-04-15
@wonderingpeanut

Your question can be divided into two parts (at least): getting files on the client via input/dropzone and sending those files to the server.
Getting files on the client
As for uploading photos to the server in mongo - in my opinion, it's not the best idea to store photos and media files in general in the database. It is better to upload them somewhere to the cloud via api and write only their url to mongo.
If you really want to store the photos themselves in Mongo, then you need to decide in what format you will store them: buffer, base64 or whatever else is there, and based on the choice, convert the user photo to the appropriate format and write

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question