显示文件选择窗口 [英] Display File Selection Window

查看:87
本文介绍了显示文件选择窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法通过JavaScript显示文件输入

字段的文件选择窗口?我的目标是模仿在

Yahoo!中看到的行为。邮寄BETA。添加附件时,单击自定义按钮/图标时会显示一个文件

选择窗口。我看到了一个使用CSS来实际定位图像后面的浏览按钮的示例

。我希望这不是唯一的选择。

解决方案

有没有办法显示文件输入的文件选择窗口


字段是否通过JavaScript?



在默认安全环境中没有,这是不可能的(除非某些浏览器中某些我不知道的安全漏洞利用)。 />


VK在11/15/2006 5:25 PM说了以下内容:


>有没有办法通过JavaScript显示文件输入
字段的文件选择窗口?



在默认安全环境中没有,这是不可能的(除非某些浏览器中某些

未知安全漏洞利用)。



< form id =" myForm">

< input type =" file" name =" myFileInput">

< button onclick =" document.myForm.myFileInput.click()">测试< / button>

< / form>


仅限IE浏览器。


现在,请解释这是一个安全漏洞。


-

兰迪

机会有利于准备好的心灵

comp.lang.javascript常见问题 - http://jibbering.com/faq

Javascript最佳实践 - http://www.JavascriptToolbox.com/bestpractices/


Mattaécrit:


有没有办法显示文件输入的文件选择窗口

通过JavaScript字段?



不,你不能(除了使用IE浏览器?使用ActiveX?)在你的

页面上显示系统文件的副本选择器。


输入''文件''自然显示一个默认按钮,可以访问这个

选择器的系统。
< blockquote class =post_quotes>
我的目标是模仿在

Yahoo!中看到的行为邮寄BETA。



url看看你说的是什么......?


添加附件时,它会显示单击自定义按钮/图标时,文件

选择窗口。



您有可能更改此按钮,在不同浏览器或/和不同系统上不会出现相同的

(Win ,Mac,Linux

....)或/和不同语言(fr,en,ur,...)。


使用的想法一个图像和css覆盖这个按钮似乎相当好b / b
好​​。 (看这个演讲的网址是什么?)


-

Stephane Moriaux et son(moins)vieuxMacdéjàdépassé

Stephane Moriaux和他的(旧)Mac已经过时了


Is there a way to display the file selection window for a file input
field via JavaScript? My goal is to emulate the behavior seen in
Yahoo! Mail BETA. When adding an attachment, it displays a file
selection window when you click a custom button/icon. I saw an example
of using CSS to actually position the browse button behind an image. I
am hoping that isn''t the only option.

解决方案

Is there a way to display the file selection window for a file input

field via JavaScript?

In the default security environment no, it is not possible (unless some
unknown to me security exploit in some browser).


VK said the following on 11/15/2006 5:25 PM:

>Is there a way to display the file selection window for a file input
field via JavaScript?


In the default security environment no, it is not possible (unless some
unknown to me security exploit in some browser).

<form id="myForm">
<input type="file" name="myFileInput">
<button onclick="document.myForm.myFileInput.click()">Test </button>
</form>

IE only.

Now, please explain how that is a "security exploit".

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/


Matt a écrit :

Is there a way to display the file selection window for a file input
field via JavaScript?

No you can''t (except with IE Windows ? with ActiveX ?) display on your
page a copy of your system files selector.

The input ''file'' naturally shows a default button to give access to this
selector''s system.

My goal is to emulate the behavior seen in
Yahoo! Mail BETA.

url to see what you talk about ... ?

When adding an attachment, it displays a file
selection window when you click a custom button/icon.

You have any possibility to change this button which doesn''t appear the
same on different browsers or/and different systems (Win, Mac, Linux
....) or/and different languages (fr, en, ur, ...).

The idea to use an image and css to cover this button seems to be quite
good. (what is the url to see this presentation ?)

--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Stephane Moriaux and his (less) old Mac already out of date


这篇关于显示文件选择窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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