Questions tagged [multer]
Multer is a node.js component used to handle multipart/form-data uploads.
multer
3,271
questions
229
votes
15
answers
293k
views
Node Multer unexpected field
I'm working on uploading a file to my app using the multer npm module.
The multer function I have defined is to allow a single file uploaded to the file system. Everything works during run time; the ...
151
votes
6
answers
191k
views
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 ...
88
votes
18
answers
116k
views
How to store a file with file extension with multer?
Managed to store my files in a folder but they store without the file extension.
Does any one know how would I store the file with file extension?
66
votes
8
answers
145k
views
express (using multer) Error: Multipart: Boundary not found, request sent by POSTMAN
Notice: only when I use form-data body form in Postman (which is the form I have to use because I want to send files beside text fields), I get:
Error: Multipart: Boundary not found.
when I use x-...
49
votes
3
answers
109k
views
How to limit the file size when uploading with multer?
I'm making a simple file upload system with multer:
var maxSize = 1 * 1000 * 1000;
var storage = multer.diskStorage({
destination: function (req, file, callback) {
callback(null, 'public/...
43
votes
7
answers
54k
views
Cannot app.use(multer). "requires middleware function" error
I'm just starting learning NodeJS and I am stuck with a problem. I would like to upload files to my server. To do so I searched and found out this module multer. Doing as the example on GitHub works:
...
42
votes
29
answers
73k
views
ENOENT: no such file or directory .?
This is error which am getting while post data and file.
I have followed 'academind' tutorial for building Restful API services, also i have been searching answer for this type of errors but nothing ...
42
votes
8
answers
99k
views
Uploading image to amazon s3 using multer-s3 nodejs
I am trying to upload an image to amazon s3 using multer-s3, but I am getting this error:
TypeError: Expected opts.s3 to be object
node_modules/multer-s3/index.js:69:20
This is my server code:
...
41
votes
6
answers
39k
views
Node.js, multer and req.body empty
Here it is my problem, I have a form where I can insert a file and a field but I receive only the file and not the parameter test! Why?
This is my code:
app.js:
var express = require('express');
...
39
votes
7
answers
97k
views
Uploading multiple files with multer, but from different fields?
How can I have multer accept files from multiple file type fields?
I have the following code that uploads a single file, using multer in node.js:
var storage = multer.diskStorage({
destination: ...
37
votes
6
answers
74k
views
Node/Multer Get Filename
I am using the following to upload files to a directory via Multer. It works great, but I need to perform some actions after upload that require the name of the file I just posted to the "upload" ...
37
votes
1
answer
30k
views
Node JS AWS S3 file upload. How to get public URL response
I'm uploading a file to Amazon S3 using the Node SDK.
The file uploads are working fine, but I want to get the public url of the file to send back to the client.
At the moment the response I get is:
...
28
votes
18
answers
56k
views
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 ...
27
votes
3
answers
16k
views
Multer create new folder with data
I use multer.
Question 1
When I put the following snippet in the app.js
app.use(multer({
dest: './uploads'
}
).single('file'));
it creates a new folder under the root folder, my question ...
24
votes
11
answers
48k
views
multer - req.file always undefined
I've looked at a lot of answer for this same question, but I haven't found a working solution yet. I am trying to make a web app that you can upload files to using express and multer, and I am having ...