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.

diskStorage not a function

See original GitHub issue

Hi, i have following code

var express = require('express');        // call express
var app = express();
var multer  = require('multer');

var storage = multer.diskStorage({
  destination: function (req, file, cb) {
    cb(null, '/software/')
  },
  filename: function (req, file, cb) {
    cb(null, 'test.tar.gz')
  }
})

var upload = multer({ storage: storage })

.....

This gives me following error while compiling:

var storage=multer.diskStorage({
                   ^

TypeError: multer.diskStorage is not a function
    at Object.<anonymous> (D:\Harvester\proxy\proxy.js:34:20)
    at Module._compile (module.js:425:26)
    at Object.Module._extensions..js (module.js:432:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Function.Module.runMain (module.js:457:10)
    at startup (node.js:136:18)
    at node.js:972:3

Tried all variations but it gives me always the same error. Using node 5.0

Any idea??

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
GuntukuChaitanyacommented, Sep 4, 2021

It is not working for me 😦

0reactions
rahul7156commented, Feb 20, 2016

thanks LinusU

Read more comments on GitHub >

github_iconTop Results From Across the Web

Multer upload is not a function - node.js - Stack Overflow
I'm using Multer to make an upload file system. I followed the instructions of the Github page but it's not working. const express=...
Read more >
multer.diskStorage JavaScript and Node.js code examples
Best JavaScript code snippets using multer.diskStorage(Showing top 15 results out of 1,044) · Most used multer functions · Popular in JavaScript.
Read more >
Express multer middleware
The disk storage engine gives you full control on storing files to disk. const storage = multer.diskStorage({ destination: function ...
Read more >
Node.js – Multer upload is not a function - iTecNote
I followed the instructions of the Github page but it's not working. ... diskStorage({ destination: function (req, file, cb) { cb(null, '/uploads'); } ......
Read more >
File uploads using Node.js - CodeForGeek
var storage = multer.diskStorage({ destination: function (req, file, callback) { callback(null, './uploads'); }, filename: function (req, file, callback) {
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