All Questions
133
questions
1
vote
0
answers
58
views
How do I upload and fetch PDF files from MongoDB
I'm posting the file as formdata but when I fetch the data, I receive a blob that returns corrupted PDF file. My goal is to store the file in Mongodb as binary data and display it in browser.
Axios ...
0
votes
0
answers
63
views
Uploading Image BLOB in react and sending post request to node express
I'm using React, typescript, React-hook-form, rtk-query and there is a simple form where one of the components is a image, which I'm trying to send with a POST request, but without success. I'm trying ...
0
votes
3
answers
47
views
how can i resolve the problem of 404 not found when i test a post request with postman
index.js code:
import express from "express"
import bodyParser from "body-parser"
import dotenv from "dotenv"
import mongoose from 'mongoose'
const app = express()
app....
0
votes
0
answers
253
views
Upload image using Multer on Next.js
In my Next.js 14 project, I have installed Multer and Mongoose. I created a schema with a name and an image field to add books to the database.
Now I can't upload pictures with Multer. After uploading ...
0
votes
1
answer
29
views
i m traying to update user profile information Database
enter image description hererouter.post('/profile/update', isLoggedIn, function(req, res, next) {
const userId = req.user._id;
userModel.findById(userId, function(err, user) {
if (err) {
return next(...
0
votes
0
answers
143
views
Verce: Cannot find module
Why is it that when I run it locally it works, but when I deploy it to Vercel it gets an error
eror msg :
Cannot find module '../sdam/server_selection'
Require stack:
- /var/task/node_modules/mongodb/...
0
votes
1
answer
54
views
ERROR [ExceptionsHandler] rooms validation failed: image: Path `image` is required
I want to upload image in mongoose database along with other room information using Buffer and Express.Multer.File in nestjs. Image show in the uploads folder in the project directory but showing ...
0
votes
0
answers
61
views
Gridfs bucket and collection issue
So I'm still trying to make a file upload and download system with gridfs and multer. I have a question regarding where I need to specify the collection, and bucket names. I put the collection that I ...
0
votes
0
answers
79
views
mongoose - multer - multer-gridfs-storage: The database connection must be open to store files
I had this error while I am trying to use multer-gridfs-storage, I want to upload files and store them in mongoDB atlas
index.js file:
require("dotenv").config();
const upload = require(&...
-1
votes
1
answer
50
views
want to upload a image with form in mongodb
there a database file on mongodb atlas called food_items i want from the frontend form to upload image an data there
Error saving food item: TypeError: global.food_items is not a constructor
at ...
0
votes
1
answer
108
views
Multer: "ENOENT: no such file or directory"
I keep getting errors and couldn't figure out what's wrong. I'm trying to upload multiple files through Mongoose. I'm kinda new at multer, any help would be appreciated, thank you.
Here's my app.js
...
0
votes
0
answers
92
views
Getting base64 binary video file and render it on UI but showing me a error on video file that is no video with supported format
I have changed my video file to base64
var path ="video file path";
let encodedData = fs.readFileSync(path).toString("base64");
and save it to mongo db
var obj = {
name: ...
0
votes
1
answer
76
views
Image is not displaying after uploading it through client and retrieving it from API
I'm currently building a React JS app that communicates with an API that I am also building with Node JS at the same time, and I am stuck on the problem of getting an image to be uploaded and be ...
0
votes
1
answer
85
views
Getting weird Internal Service Error from my API
I created registration form in React JS in the client side that allows users to not only submit their details (aka username, email, etc.), but also upload an image for their profile picture.
However, ...
0
votes
0
answers
40
views
How to save images to mongodb using multer.fields()?
I am getting a no file or directory error when trying to save my uploaded files to mongodb. I have uploaded with Multer, can anyone help me on how i can solve this issue?
this the error i am getting
...