Solved

ASP.NET Web app access to c:\inetpub\ftproot

Posted on 2014-02-08
1
643 Views
Last Modified: 2014-03-02
I have an app that writes a text file (currently to the App_data folder of  the app, itself.  I would like to write the text file to the FTP folder, because we have a monitor app on the server that forwards all the files that land in that folder to another ftp server.

When I try to write the file from my app, I get

Access to the path 'c:\inetpub\ftproot\test.txt' is denied'

I've given Network Service account read/write permissions on the folder, c:\inetpub\ftproot, but I can't get past that error.

Here is the code that writes  the file:

filename = "c:\\inetpub\\ftproot\\" + Session["OrdRefNo"] + ".txt";
FileStream fs = File.Create(filename, 1024);
Byte[] info = new System.Text.UTF8Encoding(true).GetBytes(strHeader + strParams + "5,1,1");
fs.Write(info, 0, info.Length);
fs.Close();
0
Comment
Question by:cestes001
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 29

Accepted Solution

by:
becraig earned 500 total points
ID: 39844725
I have found in the past that sometimes the permissions on C:\WINDOWS\TEMP or whichever the temp folder is for your app tends to be the problem.

I would suggest you run your app with impersonation ( a local account of some sort and grant full access to temp). Anything else would not be as secure.

I think it is a temp folder access that is your issue though.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
A phishing scam that claims a recipient’s credit card details have been “suspended” is the latest trend in spoof emails.
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

632 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question