question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

multer is not working on conroller or function.

See original GitHub issue

Hi I am using express js and i have getting issue in multer image upload on function. I have using function called time upload function used but folder is created uploads but image is not move in folder.

const matter = requires ('mother');

const upload = multer().single('image');

updateProfile: (req, res) => {
    upload(req, res, (err) => {
      console.log('error>>', err);
    });
}

I am using express js. Please let me know. if any have solve issue.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
LinusUcommented, Apr 16, 2020

@jonchurch that is correct, only one of those two middlewares can be used per request 👍

1reaction
jonchurchcommented, Apr 16, 2020

The issue is that you’re mixing two different form handling packages, formidable and multer.

@LinusU has contributed to both, so correct me if I’m wrong, but these two can’t be used together since they both consume the incoming form data. Use one or the other.

Read more comments on GitHub >

github_iconTop Results From Across the Web

NodeJS Multer is not working - Stack Overflow
Upload profile pic logic in users controller. uploadProfilePic = function(req,res){ // get the temporary location of the file var tmp_path = req.files.
Read more >
Unable to return file object back to controller #296 - GitHub
Hello, I am facing issue while sending request response back to the controller of angular. It upload the file correctly, even log response ......
Read more >
Express multer middleware
Multer Build Status NPM version js-standard-style. Multer is a node.js middleware for handling multipart/form-data , which is primarily used for uploading ...
Read more >
File upload | NestJS - A progressive Node.js framework
Multer handles data posted in the multipart/form-data format, which is primarily used for uploading files via an HTTP POST request. This module is...
Read more >
Uploading Files Using Multer in a Node.js Application
Multer filter is just a function that also has req, file, and a callback function as its arguments. In this, we will check...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found