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
1
vote
2 answers

req.file is undefined using multer with upload.array to upload an image

Can someone please tell me what's wrong in my below code? I've been debugging this for hours but no luck. var multer = require('multer') var upload = multer({ dest: '/uploads/' }) router.post('/image', upload.array('file', 12) , function(req, res)…
Thian Kian Phin
  • 921
  • 3
  • 13
  • 25
1
vote
1 answer

HTTP file upload in Express NodeJS server

I have an Express NodeJS server. I would like to upload very large files (more than 10Gb of size). I tried modules multer and formidable for this purpose. My problem is that I am not able to receive more than 1Gb in the server. In the browser I get…
user2979409
  • 773
  • 1
  • 12
  • 23
1
vote
1 answer

buffer to file stream

I would like to create file uploading app to box storage. I use box-sdk module to upload box. The box-sdk can access a file stream that is came from fs.createReadStream for uploading. I use multer module to access uploaded file. The multer module…
zanhtet
  • 2,040
  • 7
  • 33
  • 58
1
vote
2 answers

app.use(multer({dest:'./uploads/'}).single('photo')) return "Undefined is not a function"

I am trying to use multer to upload file I use latest multer (v.0.18) I configure the app this way var express = require('express') , multer = require('multer') , app = express() , routes =…
dhayyati
  • 49
  • 9
1
vote
1 answer

Image filename not getting inserted in db using Multer

I tried using multer as was specified in a tutorial. Then realized that it does not work in the same way now as it was used to be. So I checked the github page of multer and followed the documentation. However, my image though getting uploaded, the…
marukobotto
  • 759
  • 3
  • 12
  • 26
1
vote
1 answer

Uploading images to server in NodeJS+Multer?

I have a form that is used to upload images to backend written in NodeJS+Multer. Backend checks for filesize and file type so user is not allowed to uplaod any other files then png/jpg/gif. However, nothing stopping user from renaming .zip (or any…
spirytus
  • 10,726
  • 14
  • 61
  • 75
1
vote
1 answer

How to refer to a folder within the "public" static folder from an router file?

I am trying to refer to a folder called tracks_folder within my public folder from a router. The simplified structure of my project is the following app.js routes/ tracks/ router.js public/ tracks_folder/ Basically I want…
nbro
  • 15,395
  • 32
  • 113
  • 196
1
vote
1 answer

GraphicsMagick and Multer some thumbnails are not displaying when page loads

I am using Multer to store uploaded files into /uploads/ folder and also GraphicsMagick to store thumbnails in /thumbs/. When I use css to display thumbnails in the page it works fine but when I try to display the gm-created thumbnails it fails…
meanstacky
  • 387
  • 1
  • 8
  • 18
1
vote
2 answers

express multer uploaded files url

probably a stupid question but maybe someone here could help me. after uploading files with multer and express, what would be the url of the uploaded files to uploads/? var storage = multer.diskStorage({ destination: function (req, file, cb) { …
Maor Ben
  • 309
  • 4
  • 13
1
vote
2 answers

multer req.file is undefined

I try to upload a file on my node js server using multer module, but for some reasons the uploaded file is always undefined. I have based my code using the documentation here https://github.com/expressjs/multer with the easy example for one single…
vbvx
  • 609
  • 7
  • 22
1
vote
2 answers

Rename uploaded image in multer using fs

When a user uploads a picture - I'm using multer by the way - with a name that contains a space, I want to replace the white-spaces with "-" before saving the file name to my Mysql table and then also rename the file that has been uploaded to the…
Murad Elboudy
  • 463
  • 2
  • 11
  • 24
1
vote
0 answers

Multer and image upload path in nodejs

I'm doing my first web app using nodeJS with expressJS, I'm trying to upload an image to my folder "uploads", and it's work, with multer, it's uploaded, but it isn't an image it's look like 3c1dgn4vcs3c33vd, I've seek on a lot of forums but I didn't…
1
vote
2 answers

multer save image without mimetype

I'm using "multer": "^1.0.6", And i Want to save image in upload folder. My code is app.post('/post', multer({dest: './uploads/'}).single('file'), function (req, res) { response = { message: 'File uploaded successfully', filename:…
monkeyUser
  • 4,301
  • 7
  • 46
  • 95
1
vote
1 answer

Adding logic/validation to multer in node.js (express)

During file upload I want to validate the file size, make sure that the uploaded file is an actual image and last but not least validate that a title has been written for the image. But this code doesn't work. What should I do? var multer =…
Murad Elboudy
  • 463
  • 2
  • 11
  • 24
1
vote
2 answers

Express 4: How do I send JSON object to view?

I've researched for the past few days and I cannot figure this one out. Goal: User uploads a text file using the angular-file-upload form, and multer saves the file to a temporary folder. The data then POSTs and the user can see the file metadata…
heiser
  • 11
  • 4