admin管理员组文章数量:1278720
I need to know how to get full path from fileupload using javascript,
I tried using the following coding but of no use
<input type="file" id="picField" onchange="preview(this)">
<script type="text/javascript">
function preview(test){
var source=test.value;
alert(source);
}
</script>
but in the alert message, i am getting only
Filename.extension
I am not getting full path, but it is showing full path in File Upload box please help how to solve this problem
Thanks
I need to know how to get full path from fileupload using javascript,
I tried using the following coding but of no use
<input type="file" id="picField" onchange="preview(this)">
<script type="text/javascript">
function preview(test){
var source=test.value;
alert(source);
}
</script>
but in the alert message, i am getting only
Filename.extension
I am not getting full path, but it is showing full path in File Upload box please help how to solve this problem
Thanks
Share Improve this question asked Oct 28, 2009 at 5:24 Senthil Kumar BhaskaranSenthil Kumar Bhaskaran 7,46110 gold badges44 silver badges56 bronze badges3 Answers
Reset to default 4This is a browser security restriction, in modern browsers you cannot get the full client file-system path of the selected file, nor set a path programmatically...
Maybe for security reason, javascript doesn't allow this to happen. And if you e to think of it, Server side pages cannot access your local files. Not that I have a solution for your question.
Actually, there is some kind of solution.
Albeit, it will help only if you can run Electron desktop app on local machine: https://stackoverflow./a/59990858/9390914
本文标签: htmlhow to get full path from fileupload using JavascriptStack Overflow
版权声明:本文标题:html - how to get full path from fileupload using Javascript - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741285272a2370234.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论