Show Image Before Upload:
Example :1
<html>
<head>
<title>
show image before upload</title>
<script>
function showimage(ele)
{
document.ims.show.src=ele.value;
}
</script>
</head>
<body>
<form name=”ims” method=”POST”>
<input type=”file” name=”image” onChange = “return showimage(this)”>
<input type=”submit”>
<img id=”show”>
</form>
</body>
</html>
Example : 2
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″>
<script language=javascript>
function ImageArray(file, img) {
var thisImage = new Image();
thisImage.src = file.value;
document.images[img].src=thisImage.src;
document.images[img].onload=function() {alert(‘path = ‘+
document.images[img].src+
‘\nimage width = ‘+document.images[img].width+’px’+
‘\nimage height = ‘+document.images[img].height+’px’)};
}
</script>
</head>
<body>
<form name=”form1″ method=”post” action=””>
<p>
<input name=”myFile” type=”file” onchange=”ImageArray(myFile,’img1′)”>
<img id=”img1″ name=”img1″ src=””>
</form>
</body>
</html>
Example :3
<style>
.thumb {
height: 75px;
border: 1px solid #000;
margin: 10px 5px 0 0;
}
</style>
<input type=”file” id=”files” name=”files[]” multiple />
<output id=”list”></output>
<script>
function handleFileSelect(evt) {
var files = evt.target.files; // FileList object
// Loop through the FileList and render image files as thumbnails.
for (var i = 0, f; f = files[i]; i++) {
// Only process image files.
if (!f.type.match(‘image.*’)) {
continue;
}
var reader = new FileReader();
// Closure to capture the file information.
reader.onload = (function(theFile) {
return function(e) {
// Render thumbnail.
var span = document.createElement(‘span’);
span.innerHTML = [‘<img src=”‘, e.target.result,
‘” title=”‘, escape(theFile.name), ‘”/>’].join(”);
document.getElementById(‘list’).insertBefore(span, null);
};
})(f);
// Read in the image file as a data URL.
reader.readAsDataURL(f);
}
}
document.getElementById(‘files’).addEventListener(‘change’, handleFileSelect, false);
</script>
–Venugopal
this website is the leading net page. lista de email lista de email lista de email lista de email lista de email
thanks for such a great post and the review, i am totally impressed! lista de email lista de email lista de email lista de email lista de email
how long does it take you to finish a good article like this one? lista de email lista de email lista de email lista de email lista de email
great post. keep it up. lista de email lista de email lista de email lista de email lista de email
very good article, thank you for sharing. your sharing information is very useful for me, thank you! lista de email lista de email lista de email lista de email lista de email
would you mind writing more posts about this subject? lista de email lista de email lista de email lista de email lista de email
hi, great article. thanks for the opportunity to learn even more. lista de email lista de email lista de email lista de email lista de email
Sites of interest we’ve a link to.