在IE浏览器中,当我们使用< input type =; file&quot>要选择一个文件,浏览器保留该值,但是在Edge/Chrome中没有发生同一件事
我的应用程序在IE浏览器上工作正常,但是在将其迁移到Chrome时,我将面临某个问题,在IE中,每当我们单击“选择文件”按钮,然后浏览并选择一个文件,此后,当我们再次单击“选择文件”按钮时,我们可以请参阅所选文件的值显示在对话框中显示的文件名中,但是如果Chrome第二次单击按钮,则未显示以前选择的文件名值,没有任何方法可以解决此信息。
我已经浏览了许多页面,但是到处都提到,由于安全原因,我们无法使用文件选择选项做任何事情。在这种情况下,是否有任何解决方法,因为我没有尝试上传文件,只是想显示以前选择的文件名。 IE浏览器中已经发生这种情况,不确定如何在Edge/Chrome中启用它。
<label for="avatar">Choose a profile picture:</label>
<input type="file" id="avatar" name="avatar">
在上面的代码中,当我们单击“选择文件”并选择一个文件时,当我们单击下次选择文件时,在浏览器中,在文件名中显示了已经选择的文件的名称,但是在文件名中显示了同一件事边缘/铬。
My application was working fine on IE browser, but while migrating it to chrome I am facing a certain issue, in IE whenever we click on select file button then browse and select a file, after that when we click again on select file button we can see the value of selected file is shown in file name that is shown in the dialog box, but in case of chrome on clicking the button the second time, file name value that was selected before is not shown, is there any way to fix this.
I have gone through many pages but everywhere it is mentioned that we cannot do anything with file select option due to security reasons. Is there any workaround in this case, as I am not trying to upload the file, just wanted to show the file name which was previously selected. This is already happening in IE browser not sure how to enable it in EDGE/Chrome.
<label for="avatar">Choose a profile picture:</label>
<input type="file" id="avatar" name="avatar">
In the above code when we click on choose file and select a file it gets selected, when we click on choose file the next time, In IE browser the name of already selected file is shown in file name but the same thing is not happening in edge/chrome.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论