简体   繁体   English

无法访问服务器文件

[英]Can't access server file

I am trying to access server files, one for reading and other for writing. 我正在尝试访问服务器文件,一个用于读取,另一个用于写入。 The following is the path I am setting to achieve this: 以下是我为此设置的路径:

var templatePath = Server.MapPath(@"~/Templates/SRG_Template.pptx"); 
var outputPath = Server.MapPath(@"~/Output/SRG_Document.pptx");  

However, I am not able to access them. 但是,我无法访问它们。

Update : In Template folder lies the PowerPoint template which I am reading to create PowerPoint file in Output folder. 更新 :我正在阅读以在输出文件夹中创建PowerPoint文件的PowerPoint模板位于Template文件夹中。 When I run the application locally, it works fine but on running on server, the ppt file is not created. 当我在本地运行该应用程序时,它可以正常运行,但在服务器上运行时,不会创建ppt文件。

I think that your problem is IIS Security Permission. 我认为您的问题是IIS安全权限。 Did you try that? 你尝试过吗?

You must grant access to IIS_IUSRS user for read, write and modify files on Template and Output folders. 您必须授予IIS_IUSRS用户访问权限,以便读取,写入和修改Template和Output文件夹中的文件。 You can read more about this Here . 您可以在此处阅读有关此内容的更多信息。

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

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