title: Saving file in specified directory Node.js
body: <p>I want to save an image using fs.writeFile, but I'm not able to do this.</p>
  <p>The path in which i want to do this: C:\Users\poz\lotos\images\1232133123@gmail.com</p>
  <p>My code:</p>
  <pre><code>    var d = new Date();
      var n = d.getTime() + &quot;.jpeg&quot;;
      var dir = &quot;C:/Users/poz/lotos/images/&quot; + email;
  
      mkdirp(dir);
  
      var data = image.replace(/^data:image\/jpeg;base64,/,'');
  
      var dir2 = dir + &quot;/&quot;;
  
      fs.writeFile(__dirname +'/../../images/' + email + '/' + n, data, 'base64' , function(err){
        if (err)
          return console.log(err);
      });
  </code></pre>
  <p>*The folder is created.</p>
  <p>An error which I'm getting:</p>
  <p>[Error: ENOENT: no such file or directory, open 'C:\Users\poz\lotos\images\1232133123@gmail.com\1602604489722.jpeg'] {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'open',
  path: 'C:\Users\poz\lotos\images\1232133123@gmail.com\1602604489722.jpeg'
  }</p>