0
const stroge = multer.diskStorage({
    destination : function(req,file,cb){
        cb(null,**URL**)
    },
    filename : function(req,file,cb){
        cb(null,'/home/abhishek/Desktop/uplode/')
    }
})
console.log(path);
const upload = multer({ storage: stroge });

i need to pass URL path in destination http://localhost:8000/uploads/image.png

  • did you get url of the uploaded file ? – Sahil Verma Dec 20 '22 at 12:24
  • based on multer's documentation it is a middleware to handle form data, in your case since you have a url you can make a get call to the url and download the file, mutler can be used in this scenario. You can check out this link https://stackoverflow.com/questions/11944932/how-to-download-a-file-with-node-js-without-using-third-party-libraries – Grijan Dec 20 '22 at 13:04

0 Answers0