i have a simple browse which accepts only images. But after onclick button i can not get the full path in javascript so that i can send them to server by jquery post. i am only getting the filename.
javascript
<script type="text/javascript">
function post_ad() {
var img = document.getElementById('img1'),
tempimg= img.value;
alert(tempimg);
jQuery.ajax({
type: 'POST',
url: 'process.php',
data: {
tempimg: tempimg
},
success: function (html) {
}
});
}
</script>
HTML
<input id="img1" name="img1" accept="image/*" type='file'>
<input type="button" onclick="post_ad()" value="click">