Questions tagged [multer]

Multer is a node.js component used to handle multipart/form-data uploads.

Multer is a middleware for handling multipart/form-data, which is primarily used for uploading files. It is written on top of for maximum efficiency.

Multer will not process any form which is not multipart (multipart/form-data).

Github repo expressjs/multer.

Github repo busboy

3186 questions
23
votes
5 answers

Can we configure multer to not store files locally and only for using req.files.image.path?

My application's need is as follows: I upload the image to Cloudinary and store the url of image in my mongodb database. To upload the image to cloudinary, I needed to give the file path, and for that, I am using multer.I use the…
Aravind
  • 3,169
  • 3
  • 23
  • 37
22
votes
3 answers

Google Clould Functions deploy: EROFS: read-only file system

I'm trying to deploy my api to Google Cloud Functions, and I'm getting this: EROFS: read-only file system, mkdir '/user_code/uploads' ⚠ functions[post]: Deployment error. Function load error: Code in file index.js can't be loaded. Is there a…
Paulo Brito
  • 453
  • 1
  • 5
  • 15
20
votes
4 answers

how to upload file saved in memory by multer to another API

I have 2 separate NodeJS APIs that uses multer to save a file in memory. My express middleware looks like this import multer from 'multer'; const storage = multer.memoryStorage(); export default multer({ storage }).single('image'); I am able to…
Theo
  • 1,932
  • 4
  • 17
  • 40
20
votes
5 answers

Filter files on the basis of extension using Multer in Express JS

As question title explains, I need to filter uploaded files on the basis of file extension. So, I went through the official docs and searched this website. What I've Tried I've tried solutions I came across. Files are being successfully uploaded,…
A J
  • 3,970
  • 14
  • 38
  • 53
19
votes
14 answers

Unexpected end of form error when using Multer

I'm trying to upload an image (jpg/jpeg/png) from the browser to NodeJS. I have read through several tutorials and many posts on forums but very few seem to have this specific issue. I've made sure to match the name provided to multer…
Updog
  • 321
  • 1
  • 2
  • 8
19
votes
2 answers

Send blob data to node using fetch, multer, express

Trying to send a blob object to my node server. On the client side I'm recording some audio using MediaRecorder and then I want to send the file to my server for processing. saveButton.onclick = function(e, audio) { var blobData =…
darkace
  • 838
  • 1
  • 15
  • 27
19
votes
3 answers

Uploading multiple files with Multer

I'm trying to upload multiple images using Multer. It all works as expected except that only one file is being uploaded (the last file selected). HTML
Runny Yolk
  • 1,074
  • 3
  • 23
  • 41
19
votes
5 answers

Tracking progress of file upload in multer nodejs

How to track progress of a file getting uploaded to NodeJs server .I am using multer in server side to upload files. ? Do i need to send some kind of information to the client , So that client gets the upload progress OR this is done internally &…
Furious
  • 473
  • 2
  • 5
  • 21
19
votes
5 answers

How do I send a file from postman to node.js with multer

Windows Express 4.12.4 Multer 1.0.1 Node v0.10.22 I'm trying to send a file to my node.js server using postman. I'm attempting to follow the readme here Here's what I'm sending with postman: POST /ingest HTTP/1.1 Host:…
user773737
18
votes
4 answers

Can't get multer filefilter error handling to work

I'm playing around with file uploading in Node.js/Multer. I got the the storage and limits working. But now im playing around with filefilter to simply deny some files by mimetype like this: fileFilter: function (req, file, cb) { if (file.mimetype…
Merijn de Klerk
  • 953
  • 2
  • 11
  • 21
18
votes
3 answers

Use multer for File-Uploads inside a Express Router

I got a working REST-API built with node.js and Express. Now I need a file-upload endpoint, which accepts uploaded files and processes them. I am using an Express Router and some Authentication middleware. server.js (excerpt) var router =…
lukas293
  • 518
  • 1
  • 3
  • 15
18
votes
6 answers

Renaming an uploaded file using Multer doesn't work (Express.js)

I'm trying to upload a file from a HTML form using Express.js and Multer. I've managed to save the file to the desired location (a folder named uploads). However, I'd like to rename the file while uploading it because, by default, Multer gives it a…
Vincent Montalieu
  • 333
  • 2
  • 4
  • 10
17
votes
3 answers

NestJS - How to upload image to aws s3?

I'm trying to perform an image upload to aws s3 using multer-s3 on NestJS API. I have also tried aws-sdk. I use FileInterceptor and UploadedFile decorator to capture the file request. So far what I have is: // Controller @Post() …
hnakao11
  • 785
  • 2
  • 9
  • 30
17
votes
5 answers

nodejs multer diskstorage to delete file after saving to disk

I am using multer diskstorage to save a file to disk. I first save it to the disk and do some operations with the file and then i upload it to remote bucket using another function and lib. Once the upload is finished, i would like to delete it from…
jacky
  • 524
  • 1
  • 5
  • 15
17
votes
9 answers

Error handling when uploading file using multer with expressjs

I am using multer to save the file on server developed through express & nodejs. I am usign following code. var express = require('express'), multer = require('multer') var app = express() app.get('/', function(req, res){ res.send('hello…
SharpCoder
  • 18,279
  • 43
  • 153
  • 249