跨服务器文件夹浏览在Web应用程序中不起作用. [英] Cross server folder browsing is not working in web applications.

查看:98
本文介绍了跨服务器文件夹浏览在Web应用程序中不起作用.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我们有两个服务器,Server1和Server2,每个服务器下都有共享文件夹,可以在任何服务器上访问.

We have two servers, Server1 and Server2, both having the shared folders under each can be accessible on any server.

我们已经实现了文件夹浏览功能,当我们在开发环境中通过Visual Studio访问时,该功能可以按预期工作.

We have implemented a folder browse functionality , which works as expected when we access through Visual Studio in development environment.

但是,当应用程序同时部署在两个服务器IIS上并尝试访问跨服务器路径时,将拒绝提供对该路径的错误访问.

But when the application deployed on both the servers IIS and tries to access cross server path , Its giving an error access to the path is denied.

请考虑一下,为什么要通过Web应用程序进行这种行为?即使跨文件夹访问可与文件夹资源管理器一起使用.

Please give any thought if you have, why this behavior through web application?? even though the cross folder access works with folder explorer.

此致

Shankar

推荐答案

让我猜,您的文件夹浏览"函数创建为客户端函数,而不是服务器端函数(例如,要调用 Directory.GetDirectories()并在网格上自己显示结果),对吗?就像试图在客户端启动notepad.exe一样,它无法通过这种方式工作.

Let me guess, your "folder browsing" function is created as client side function, not server side one (say, to call Directory.GetDirectories() and display the result yourself on a grid), right? Much like trying to launch notepad.exe on client side, it will not work this way.

如果您的代码确实是那种调用Directory.GetDirectories()枚举文件夹并将其显示在自定义UI上的代码,请尝试检查并查看您的ApplicationPool是否有权访问该共享文件夹.可以运行应用程序池会更好 在普通域用户帐户下,并以UNC路径而不是映射的网络驱动器访问共享.

If your code is really the kind that call Directory.GetDirectories() to enumerate folders and display them on your custom UI, try check and see if your ApplicationPool have access to that shared folder. It'd be better if you can run the application pool under a normal domain user account and access the share as UNC path rather than mapped network drive.


这篇关于跨服务器文件夹浏览在Web应用程序中不起作用.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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