在IE上自动打开文件输入 [英] Auto open file input on IE

查看:60
本文介绍了在IE上自动打开文件输入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以自动打开IE中输入的文件?

Is it possible to auto open the file input on IE?

如果愿意

$(input).click();

IE不提交表单.也许我可以通过某种方式获得其价值?

IE doesn't submit the form. Maybe i can get its value somehow?

$(input).val()

不起作用,这将为您提供伪造路径.

Doesnt work, this will give you fakepath.

对此有任何想法吗?克隆也不起作用.另一种可能是,将打开按钮放在页面上的其他位置,而无需输入路径.

Any Idea about this? Cloning does also not work. Another possibility woudl be, to place the open button somwhere else on the page, without the input box for the path.

像这样的某种方式有可能吗?我有一些img,如果您单击这些图像,应该会弹出一个文件浏览器.也许有一些我可以使用的插件?有什么吗?

Is anything like this possible somehow? I have some img's and if you click on these images a file browser should pop up. Maybe theres some plugin i could use? Anything?

现在尝试几个小时.

推荐答案

出于安全目的,您无法获取该路径.但是,您可以使用一种变通方法来将传统输入元素隐藏在您的自定义设计之后,如下所示示例 http://www.quirksmode.org/dom/inputfile.html

You can't get the path for security purposes .. but you can use a workaround solution to hide the traditional input element behind your custom design , like the following example http://www.quirksmode.org/dom/inputfile.html

这篇关于在IE上自动打开文件输入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆