通过浏览按钮获取文件路径 [英] getting file path through browse button
问题描述
我在我的 html 表单中放置了一个浏览按钮.在它的帮助下,我只想获取文件路径而不是文件本身.例如:如果我浏览到D:\Raghu\hgg",我想要的只是路径本身,而不是hgg"文件夹.是否可以?非常感谢任何提示.
i have put a browse button in my html form. with the help of it i just want to get only the file path not the file itself. for ex: if i browse to "D:\Raghu\hgg" all i want is the path itself, not the "hgg" folder. is it possible? any hint is very much appreciated.
推荐答案
所有现代浏览器只会给你文件名;这是由于某种安全问题.不过,所有版本的 IE 都会为您提供完整路径(您必须更改安全设置才能在 IE8 中获得完整路径).
All modern browsers will only give you the filename; this is due to some sort of security issue. All versions of IE will give you the complete path though (you have to change a security setting to get the complete path in IE8).
简而言之,我认为您现在无法获得完整路径.
In short, I don't think you can't get the full path these days.
这篇关于通过浏览按钮获取文件路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!