简体   繁体   English

允许使用IIS7从asp.net网页读取,写入和执行文件

[英]Allow read, write and execute files from asp.net web page using IIS7

I am going to host external site (not in domain). 我要托管外部站点(不在域中)。 I have used IIS7 and given access to anonymous access to all users. 我已经使用IIS7,并授予所有用户匿名访问权限。 I have login screen and only users who successfully login will get access to another page (Page2.aspx). 我有登录屏幕,只有成功登录的用户才能访问另一个页面(Page2.aspx)。 All these users are in database. 所有这些用户都在数据库中。

In Page2.aspx, I am creating one xml file which will be saved in server drive. 在Page2.aspx中,我正在创建一个XML文件,该文件将保存在服务器驱动器中。 After writing success, I am reading one API exe (curl.exe) file which will send the xml file info to another site. 写入成功后,我正在读取一个API exe(curl.exe)文件,该文件会将xml文件信息发送到另一个站点。 If anything wrong, it writes to log.txt file which is also in same folder of website. 如果有任何错误,它将写入同样位于网站同一文件夹中的log.txt文件。

Everything works if I run locally. 如果我在本地运行,一切正常。

It looks like, it has no permission to read/write and execute the file. 看起来,它没有读取/写入和执行文件的权限。 I have given permission to Network Service, Anonymous access to read/write and execute file but no luck. 我已授予网络服务许可,可以匿名访问以读取/写入和执行文件,但没有运气。

Could you please help me. 请你帮助我好吗。

You'll need to give permissions to the IIS_IUSRS group or the IIS_IUSR user on the server. 您需要向服务器上的IIS_IUSRS组或IIS_IUSR用户授予权限。 IIS 7's default set up is to run the application pool using the ApplicationPoolIdentity which typically means either of the previous roles / users. IIS 7的默认设置是使用ApplicationPoolIdentity运行应用程序池,该应用程序池通常表示先前的角色/用户之一。 Only if the administrator has changed the default to the Network Service will that account ever be touched. 只有管​​理员将默认值更改为“网络服务”后,该帐户才会被触摸。

转到您希望用户具有访问权限的文件夹,然后添加具有所需权限的用户IUSR

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM