-1

module.exports.uploader=function(fileobj){
 fileobj.mv('./127.0.0.1:3000/uploadedImage',function(error){
        console.log(error);
 });
}

This is the error:

Error: ENOENT: no such file or directory, open 'D:\programming\bnl\127.0.0.1:3000\css' at Error (native)

TGrif
  • 5,725
  • 9
  • 31
  • 52
Shan Menaka
  • 41
  • 2
  • 13

1 Answers1

1

If I didn't understand it wrong, you're trying to move the fileobj to the uploadedImage folder, right?

You shouldn't pass the host as a path. This is why you're getting the error.

Try to put the path to the uploadedImage folder relative to your project folder. Something like this:

module.exports.uploader = function(fileobj){
 fileobj.mv(_dirname + '/path/to/uploadedImage', function(error){
  console.log(error);
 });
}
Bruno Poeta
  • 521
  • 2
  • 9