title: How to delete local file with fs.unlink?
body: <p><strong>CODE:</strong></p>
  
  <pre><code>fs.unlink("/public/images/uploads/"+req.file.filename, (err) =&gt; {
          if (err) {
              console.log("failed to delete local image:"+err);
          } else {
              console.log('successfully deleted local image');                                
          }
  });
  </code></pre>
  
  <hr>
  
  <p><strong>ERROR MESSAGE IN CONSOLE/TERMINAL:</strong></p>
  
  <pre><code>failed to delete local image:Error: ENOENT: no such file or directory, unlink '/public/images/uploads/ed6d810405e42d0dfd03d7668e356db3'
  </code></pre>
  
  <hr>
  
  <p><strong>SITUATION</strong></p>
  
  <p>I must have specified the wrong path. I don't understand why it would be wrong, the "<code>public</code>" folder is at the same level as the "<code>app.js</code>" file. The "<code>upload.js</code>" is in a folder called "<code>routes</code>" which is at the same level as "<code>app.js</code>".</p>
  
  <p>And I have specified a route "/public" to my public folder in my app.js:</p>
  
  <pre><code>//Static Folder
  app.use("/public",express.static(path.join(__dirname, "/public")));
  </code></pre>
  
  <hr>
  
  <p><strong>QUESTION:</strong></p>
  
  <p>What have I done wrong ?</p>