Nitish
Nitish

Reputation: 14113

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. When I run the application locally, it works fine but on running on server, the ppt file is not created.

Upvotes: 0

Views: 144

Answers (1)

Mojtaba
Mojtaba

Reputation: 1620

I think that your problem is IIS Security Permission. Did you try that?

You must grant access to IIS_IUSRS user for read, write and modify files on Template and Output folders. You can read more about this Here.

Upvotes: 1

Related Questions