Does PostedFile.FileName work differently in .Net 4.0?

青春壹個敷衍的年華 提交于 2019-12-06 00:21:59

I assume that it's not .NET but the internet explorer which growed up in security.

From here:

Additionally, the “Include local directory path when uploading files” URLAction has been set to "Disable" for the Internet Zone. This change prevents leakage of potentially sensitive local file-system information to the Internet. For instance, rather than submitting the full path C:\users\ericlaw\documents\secret\image.png, Internet Explorer 8 will now submit only the filename image.png.

So you could

  1. Change the logic in the server-side code - It should not be dependent on the client-side file path location and should simply use the FileName property of the FileUpload control.

  2. Enable the IE 8 / IE 9 option to include the local directory path for the Internet Zone on the client-side(annoy the user).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!