title: Save canvas dataurl to user's file system
body: <p>Okay, so, I have a MVC app where I'm creating a canvas image, and getting the data url just by doing canvas.toDataURL("image/png"). What I'd like to do is save this to the user's file system.</p>
  
  <p>I tried doing it just with javascript by doing:</p>
  
  <pre><code>var saveUrl = canvas.toDataURL("image/png");
  saveUrl = saveUrl.replace("image/png", "application/octet");
  window.open(saveUrl);
  </code></pre>
  
  <p>But that just gives me a file named <code>download</code> without any extension or anything. I'd like to get the save dialog and give the file a type and name, and save that to the user's disc.</p>
  
  <p>So I figured I could post the data to the server, and then do something with the response headers to tell the browser that I'm trying to save an image for it, but I can't find a good way to do this. I'm using ASP.NET MVC. Does anyone have a good easy way for me to do this?</p>