I tried this:
Code:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Untitled Page</title>
<script language="javascript">
function setImage(upload){
var imgPreview = document.getElementById("imgPreview");
imgPreview.src = upload.value;
}
</script>
</head>
<body>
<input id="File1" type="file" onchange="setImage(this);" /><br />
<br />
<img src="" id="imgPreview" alt="Image Preview" height="200" />
</body>
</html>
This works in I.E. but I couldn't get it to work in Firefox or Opera. I think it has to do with the way that non-i.e. browsers deal with local file urls. Short of this, you can't show the user the picture until it's uploaded and you feed it back to them from the server.
-
Peter