Here in this code i use <input type="file>
and i want a full path after user browse any file.
HTML
<input class="file_upfile" type="file" />
<input class="btn_showpath" type="button" value="Show Full Path"/>
<p class="p_upfilepath">Full path will display here<p>
Here i use $('.classname').val();
function but return only FILENAME.txt(e.g) in FireFox and if i use this same code in IE and Chrome return "C:/fakepath/myfilename.txt"
jQuery
/* Here <p> show only file name, I want a full path of file
like "c:\something\folder\filename.txt" */
$('.btn_showpath').click(function(){
var getpath = $('.file_upfile').val();
$('.p_upfilepath').slideUp(function(){
$('.p_upfilepath').text('"'+getpath+'"').slideDown();
});
});
CSS
.p_upfilepath{
background:#aaaaaa;
padding:3px 10px;
width:auto;
color:#555555;
}