title: Javascript to simulate "right click on image -> save image as"
body: <p>OK, there has been an extact duplicate question as this one, but it's been 2 years away, and there's only one answer which was not really a solution.</p>
  
  <p>So, I have an image (thumbnail), right below it there are 2 buttons: <code>View</code> and <code>Download</code>.</p>
  
  <p>View will open the image in browser (cached). And the Download button will open the Save Image dialog.</p>
  
  <p>Right now I'm using PHP's header <code>Content-Disposition: attachment;</code> for the download button.</p>
  
  <p>Generally, visitors will first hit the <code>View</code> button to preview (thumbnail is not a solution since details and quality need to be verified), especially for my own app.</p>
  
  <p>Now, I don't really want the file to be read again through PHP since it takes time. And for a better user experience, <strong>is it possible to simulate "right click on image -> save image as" so the download dialog pops up, and visitors only need one single click to download?</strong></p>