Solved

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

Posted on 2014-02-08
1
636 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
1 Comment
 
LVL 28

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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Debug Tools to analyse IIS process: This article focus on taking memory dumps from IIS to determine which code is taking more time and to analyse which calls hangs/causes more CPU usage. To take dumps,download the following. Install1: To st…
Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

708 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now