title: HTML5 download attribute doesn't work, Forcing file rename on download
body: <p>I am trying for weeks to change the name of the file being downloaded. But still no luck. Instead of file name to be <code>Chrysanthemum.jpg</code>, it becomes the hash of the file, i.e. <code>241693260.jpg</code></p>
  
  <p>In my back-end I am using Node.js and Express.js to handle file upload/download. I am hashing the file name and attributes to make sure files are not getting overwritten. </p>
  
  <p>Here is the HTML code:</p>
  
  <pre><code>&lt;a class="btn btn-info" href="http://localhost:3000/getAttachments?name=Chrysanthemum.jpg&amp;amp;type=image%2Fjpeg&amp;amp;size=879394&amp;amp;lastModified=1247549551674&amp;amp;extension=jpg" download="Chrysanthemum.jpg" target="_blank"&gt;Download File&lt;/a&gt;
  </code></pre>
  
  <p>Here is my back-end:</p>
  
  <pre><code>app.use('/uploads', express.static(__dirname + "/uploads"));
  
  app.get("/getAttachments", function (req, res) {
      try {
          var fileToBeSent = hashCode(req.query.name + req.query.type + req.query.size + req.query.lastModified + req.query.extension);
          fileToBeSent += req.query.extension  ? '.' + req.query.extension : '';
  
      // res.sendFile("./uploads/" + fileToBeSent, {
      //     root: __dirname,
      //     "Content-Disposition": '"attachment; filename="' + (req.query.extension  ? '.' + req.query.extension : '') + '"',
      //     "Content-Type": "application/octet-stream"
      // });
  
          res.redirect("/uploads/" + fileToBeSent);
      } catch (err) {
          console.log("an attempt to GET a file that doesn't exist.");
      }
  });
  </code></pre>
  
  <p><strong>So as I am renaming the file name in my back-end</strong>, I am trying to rename file back to it's original name using HTML5 but I am not being successful.</p>
  
  <p><strong>UPDATE</strong>: Using the express's sendFile result in the same issue.</p>
  
  <p><strong>UPDATE</strong>: My server is uses cross-origin</p>