title: Nodejs deleting uploaded files after specific time
body: <p>I am building a hosting server with Node and MongoDB. Process of working look something like this:</p>
  
  <ol>
  <li>User open page with form which contains 4 inputs:
  
  <ul>
  <li>sender email</li>
  <li>receiver email</li>
  <li>message from sender to receiver</li>
  <li>files (multiple)</li>
  </ul></li>
  <li>User fills all inputs properly and sends POST request on server.</li>
  <li>Server handles form with multer and saves files, then in callback the object with fields data where is stored info received from form is prepared and sent to database on MongoLab.</li>
  <li>In callback of saving doc in database, server sends mails to sender and receiver with generated link from where they can download uploaded files.</li>
  </ol>
  
  <p>Now I would like to implement additional input to form, where user can set date when his files should be deleted from the server.</p>
  
  <p>So there are two things to do: delete files and delete doc in database on time set by the user.</p>
  
  <p>Do you have some ideas how to implement such thing?</p>