从浏览器获取目录绝对路径的最简单方法
我允许我的用户从目录上传文件。我使用 SWFUpload 以便他们可以轻松上传多个文件。但是,我需要获取它们上传的目录的绝对路径。
一些研究告诉我,它不能用纯 HTML/Javascript 或 Flash 来完成。
Java 小程序似乎支持这一点,所以这就是我计划使用的。我猜ActiveX也可以做到这一点,但我对ActiveX的东西了解不多,所以我宁愿避免它。
另外,我可以假设用户正在使用 Windows(XP 或更高版本)和 IE。
我是否缺少一种更简单的方法(除了编写 Java 小程序)?让用户在文本字段中输入目录是一种选择,但不是一个很好的选择...
谢谢!
I allow my users to upload files from a directory. I use SWFUpload so that they can upload multiple files easily. However, I need to get the absolute path of the directory from which they are uploading.
A little research tells me that it can't be done in plain HTML/Javascript or in Flash.
Java applets seem to support this, so that's what I'm planning on using. I guess ActiveX can also do it, but I don't know much about ActiveX stuff, so I would rather avoid it.
Also, I can assume that the users are using Windows (XP or greater) and IE.
It there an easier way (other than writing a Java applet) that I'm missing? Having the user type in the directory into a textfield is an option, but not a very good one...
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,它不能正常完成,并且Java并不是每个人都启用的
所以,除了文件上传框之外,放置一个额外的文本框,并要求用户复制并粘贴完整路径在那里。
PS:这确实是选择之一
Yes, Its cannot be done normally, and Java is not enabled by everyone
So, Put a extra textbox other than file upload box, and ask users to copy and paste the full path there.
PS: Thats really one of the option