横跨在ASP.NET领域上传文件 [英] Uploading files across domains in ASP.NET

查看:114
本文介绍了横跨在ASP.NET领域上传文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一个小麻烦,我想看看你的所有建议。 感谢您的输入。

Having a little trouble and i wanted to see what you'd all suggest. Thanks for your input.

我们有一个ASP.NET网站,一个特点是,这个网站将允许用户上传文件,然后在服务器将它们保存到UNC路径。

We have an ASP.NET website, one feature is that this website will allow users to upload files and then the server saves them to a UNC path.

我们的一些用户无法上传文件。我认为这很可能是安全性问题,因为这些用户在不同的领域,因此不能访问的UNC路径在哪里 该系统正试图保存文件。

Some of our users cannot upload the files. I think this would likely be security issues as these users are in a different domain and therefore cannot access the UNC path to where the system is trying to save the file.

该网站使用Windows身份验证来验证用户。 文件服务器和Web服务器是2个独立的机器,但都设在一个域 用户从其他网域

The web site uses Windows authentication to validate users. The file server and the webserver are 2 separate machines but are located within one domain the users are coming from another domain

系统正在使用 System.Web.HttpPostedFile.SaveAs(字符串SaveLocation) 保存文件

the system is using System.Web.HttpPostedFile.SaveAs(String SaveLocation) to save the file

我想不通就是为什么文件不被使用的应用程序池的设置保存 以及如何配置这不尝试使用客户端凭据保存文件。

what i can't figure out is why the file is not being saved using the AppPool's settings and how to configure this to not try to use the client credentials to save the files.

编辑: 我想,如果它是由应用程序池超过所有用户的控制将有麻烦。但它似乎只是具有文件服务器的域以外的人。

I thought if it was controlled by the app pool than ALL of our users would be having troubles. but it seems to just be the ones outside the domain that has the fileserver.

有什么想法?

谢谢你的洞察力。

推荐答案

你有<身份冒充=真/> 在你的web.config?

Do you have <identity impersonate="true" /> in your web.config?

如果是这样,你正在使用您的客户端用户凭据,以保存该文件;在这种情况下,可能会更好,如果你可以只使用你的应用程序池帐户以及适当的文件系统权限授予它。

If so, you're using your client user credential to save that file; in this case, probably will be better if you could use just you application pool account and grant it with proper file system permissions.

您可以定义凭证这样

<identity impersonate="true" 
          userName="domain\username"
          password="password"/>

这篇关于横跨在ASP.NET领域上传文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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