Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2014-02-08
1
Medium Priority
?
645 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 2000 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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

The System Center Operations Manager 2012, known as SCOM, is a part of the Microsoft system center product that provides the user with infrastructure monitoring and application performance monitoring. SCOM monitors:   Windows or UNIX/LinuxNetwo…
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

664 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