How do you show a preview image when allowing file uploads in ASP.NET?
<p>Here is the functionality I want:</p>

<p>User selects an image from their machine, hits an Upload button (or better yet the following fires on the onchange event of the file input), and is able to see a preview of the image they are about to upload.</p>

<p>Here is the current workflow I am using, but it seems suboptimal:</p>

<p>I have an image control, a file input control and a submit button control.  When the submit button is clicked, the codebehind handles the OnClick event and loads the image from the file input element.  It then stores it into a temporary folder on the web server and sets the image control's ImageUrl to point to it.</p>

<p>This works, but results in me having to do a lot of janitorial duty in cleaning up these temporary images.  Is there a cleaner workflow for doing this?</p>
