Skip to content
Advertisement

Tag: multer

Uploading an image to an API with multer

I’m trying to make an application that requires image uploading and storing, I’m using Express, Mongoose and Multer and trying to upload to MongoDB. Currently when I try to upload an image, Multer does create a folder and store the image in that folder, but it doesn’t save the item to the database and it crashes the server giving the

Node.js – How do I upload an image to Backblaze b2?

I am getting connect Request failed with status code 400 from b2.uploadFIle() Here’s what I tried to do: Step 1: Download backblaze-b2 node.js library and multer(to get image file in req.body) Step 2: Set up how I’m going to call my route in POSTMAN. I have attached an IronMan.png in my request. Step 3: Set up my code: I used

How to find the size of the file in Node.js?

I am using multer for uploading my images and documents but this time I want to restrict uploading if the size of the image is >2mb. How can I find the size of the file of the document? So far I tried as below but not working. Can anyone please help me? Answer To get a file’s size in megabytes:

Advertisement