firefox中输入类型文件中的路径问题 [英] path issue in firefox in input type file

查看:58
本文介绍了firefox中输入类型文件中的路径问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我面临着Firefox的问题,没有从jquery的输入类型文件中获取所选文件的完整路径,它与IE的工作正常



例如。当我在输入文件中选择文件c:\ demo\image1.jpg时。 IE在jquery中提供相同的路径,但Firefox只提供文件名image1.jpg,因此我无法保存图像。在数据库中



请为此建议解决方案。

Hi everyone,
I am facing problem with Firefox ,not getting full path of selected file from input type file in jquery ,its working fine with IE

eg .when i select file "c:\demo\image1.jpg" in input file. IE give same path in jquery but Firefox give only file name "image1.jpg" because of this i am not able to save image . in database

Please suggest solution for this.

推荐答案

AFAIK,没有解决方案。由于安全原因,最近的浏览器不再传递完整的文件路径。



这也是你在后面的代码中得到的:

AFAIK, there is no solution to it. Recent browsers do not pass on the full filepath any more because of security reasons.

This is what you can get that too in code behind:
string path = FileUpload1.PostedFile.FileName 





查看以下关于类似主题的讨论:

FileUpload丢失目录路径。 [ ^ ]

FileUpload.PostedFile.FileName没有在chrome中提供完整路径 [ ^ ]


这篇关于firefox中输入类型文件中的路径问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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