关于附件控件隐藏后,在IE下不能上传,报“拒绝访问”

2023-02-12,,,,

报错时的使用:

@Html.TextBoxFor(m => m.FileName, new { style = "width:457px;", @readonly = "readonly" })
<button class="btn" type="button" onclick="$('#attachFile').click()"><span class="fa fa-folder"></span>选择</button>
<input id="attachFile" onchange="attachFileChange()" type="file" name="attachFile" style="display:none;" />

修改后的使用:

@Html.TextBoxFor(m => m.FileName, new { style = "width:457px;", @readonly = "readonly" })
<button class="btn" style="" type="button"><span class="fa fa-folder"></span>选择</button>
<input id="attachFile" style="position:absolute;left:0px;top:0;width:520px;height:100%;z-index:999;opacity:0;filter:alpha(opacity=0);-moz-opacity:0;-kh tml-opacity:0;" onchange="attachFileChange();" type="file" name="attachFile" />

修改后测试通过

关于附件控件隐藏后,在IE下不能上传,报“拒绝访问”的相关教程结束。

《关于附件控件隐藏后,在IE下不能上传,报“拒绝访问”.doc》

下载本文的Word格式文档,以方便收藏与打印。