1<html>
2<head>
3<script type='text/javascript'>
4function preview_image(event)
5{
6 var reader = new FileReader();
7 reader.onload = function()
8 {
9 var output = document.getElementById('output_image');
10 output.src = reader.result;
11 }
12 reader.readAsDataURL(event.target.files[0]);
13}
14</script>
15<style>
16body
17{
18 width:100%;
19 margin:0 auto;
20 padding:0px;
21 font-family:helvetica;
22 background-color:#0B3861;
23}
24#wrapper
25{
26 text-align:center;
27 margin:0 auto;
28 padding:0px;
29 width:995px;
30}
31#output_image
32{
33 max-width:300px;
34}
35</style>
36</head>
37<body>
38<div id="wrapper">
39 <input type="file" accept="image/*" onchange="preview_image(event)">
40 <img id="output_image"/>
41</div>
42</body>
43</html>