文件上传无法在mozila firefox中运行。 [英] File upload not working in mozila firefox.

查看:91
本文介绍了文件上传无法在mozila firefox中运行。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在按钮内设计了一个Fileupload控件。它正在谷歌Chrome浏览器和文件上传,并保存一切正常工作。



但是当我想浏览Mozila Firefox中的任何文件时,文件上传控件不起作用。



这是我的代码。



 <   td      =  TableSix  >  
< 按钮 type = button class = TableTh ree style = position:relative; >
< asp:FileUpload ID = btnGovt_Id_Upload runat = server 占位符 = 浏览 class = TableThree 样式 = 宽度:100%;不透明度:0.0;颜色:#c4c4c4; position:absolute; / >
BROWSE < / button > < / td > ;











谢谢



Bigyan Sahoo



我尝试了什么:



当我删除按钮然后它工作正常但是当我使用按钮的样式然后它在Firefox中不起作用。

解决方案

当您将控件嵌套在< button> 中时,该按钮会收到单击,并且不会将其传递给不可见的文件上传控件。



尝试将其嵌套在< label> 代替:

使用Bootstrap 3打造文件输入形状·美丽的网站 [ ^ ]

  <   label     class   =  btn btn-default btn-file >  
浏览< 输入 type = file style = display:none; >
< / label >



 btn-file  {
position relative;
溢出 隐藏;
}
btn-file 输入[type = file] {
position 绝对;
top 0;
right 0;
min-width 100%;
min-height 100%;
font-size 100px;
text-align right;
filter alpha(opacity = 0);
不透明度 0;
大纲 无;
背景 white;
游标 inherit;
显示 block;
}





或者,使用预先构建的插件 - 例如: Bootstrap文件输入 [ ^ ]


Quote:

我想将文件上传控件设计为一个文本为BROWSE的按钮。

然后你必须使用假控件。



因此,隐藏实际的文件上传控件和其他按钮点击事件,只需使用JavaScript / jQuery动态单击文件上传控件

I have designed a Fileupload control inside a button. It is woking finr in Google Chrome and file upload and save everything work perfectly.

But when I want to browse any file in Mozila Firefox the file upload control does not work.

Here is my code.

<td class="TableSix">
                                                <button type="button" class="TableThree" style="position: relative;">
                                                    <asp:FileUpload ID="btnGovt_Id_Upload" runat="server" placeholder="BROWSE" class="TableThree" Style="width: 100%; opacity: 0.0; color: #c4c4c4; position: absolute;" />
                                                    BROWSE</button></td>






Thanks

Bigyan Sahoo

What I have tried:

When I remove the button then it is working fine but when I use the button for style then its not working in Firefox.

解决方案

When you nest the control inside a <button>, that button receives the click, and does not pass it on to the invisible file upload control.

Try nesting it inside a <label> instead:
Whipping File Inputs Into Shape with Bootstrap 3 · A Beautiful Site[^]

<label class="btn btn-default btn-file">
    Browse <input type="file" style="display: none;">
</label>


.btn-file {
    position: relative;
    overflow: hidden;
}
.btn-file input[type=file] {
    position: absolute;
    top: 0;
    right: 0;
    min-width: 100%;
    min-height: 100%;
    font-size: 100px;
    text-align: right;
    filter: alpha(opacity=0);
    opacity: 0;
    outline: none;
    background: white;
    cursor: inherit;
    display: block;
}



Alternatively, use a pre-built plugin - for example: Bootstrap File Input[^]


Quote:

I want to design the file upload control look like as a button with text as BROWSE.

Then you have to use fake controls.

So, hide the actual file upload control and on the other button click event, just click the file upload control dynamically using JavaScript/jQuery.


这篇关于文件上传无法在mozila firefox中运行。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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