i am trying to upload an image to the localhost server, but the file is not uploading.when i click on 'upload the image' it does not show anything, i searched a lot about it but i don't know where the problem is.
here is my code
<label id="file1">Upload image
<input onchange="readurl2()" id="input" type="file" name="image" size="60" required>
</label>
<br>
<img id="blah" src="..\images\avatar.png" alt="avatar">
js function
function readurl2()
{
input=document.getElementById('input');
if (input.files && input.files[0])
{
var reader = new FileReader();
reader.onload = function (e)
{
document.getElementById('blah').src=e.target.result;
};
reader.readAsDataURL(input.files[0]);
return "done";
}
}
please help me.!!