I am not able to solve this problem. there are many ways
I need url like https//local host..
My mongo db my video is store how i can get
I am not able to solve this problem. there are many ways
I need url like https//local host..
My mongo db my video is store how i can get
2
Answers
you have to save that file in server directory and get the directory path and save in mongodb with your host name and port
Well, We don’t actually save videos in MongoDB database. Instead we save them in a folder and save the path to the video in the database.
I’m using NodeJS with MongoDB to achieve the functionality that you want.
Step 1
First create a node project and install these dependencies/libraries in the project.
express-fileupload
library will allow you to accept files in form-data. It creates a propertyfiles:[]
in thereq
object.Step 2
Once, all the essential libraries are installed you can move forward with the second step. We’ll write code in the
index.js / app.js
file..env
Step 3
Now first of all create a folder
public
in the top level directory of your project and create a sub folderprofiles
in it.All of your images will be saved here. Once, You’ve performed these instructions you can finally create a route in your main file.