Accessing a TEXT file

G

Guest

Hi

Is there a way using an Intranet ASP.NET web application to access a text file from a specified folder

The Logic

ReadTextFile.asp
-------------------
FILE = "a_comma_delimited_text_file.txt
PATH = "C:\folder\subfolder\
ACCESS = PATH+FIL
Open for READONLY
Save it to SQL2000 databas
-------------------
When someone in the organiztion connected to the network access this page
1) Is it possible for my ASPX page to read the FILE
2) Is there a permission that can be administered to make it work
3) Can ACCESS = PATH+FILE be a folder on every computer in my organization an accessible folder from my REadTextFile.aspx

I'd appreciate your input

Sincerely

Yama Kamya
Sr. Micorsoft .NET Consultan
 
M

Mark Jen [MSFT]

Hi Yama,

It is possible for your ASP.NET page to access files both on the local
machine and over network shares. Using the System.IO namespace, you should
be able to do any file access/reading/writing operations necessary. (See
msdn for more information on these classes:
http://msdn.microsoft.com/library/d...en-us/cpref/html/frlrfSystemIO.asp?frame=true)
The only difficulty is specifying the correct privileges for your page.

To specify privileges for your page, you want to open up the IIS Manager
(this is usually under Administrative Tools).
Then you have two options:

1. You can define a new Application Pool that runs with some specific,
configured Identity that has security access to the file you want to read.
Then you set the Application Pool of the web application to this newly
configured pool. Make sure your in web.config you have <identity
impersonate="false" />
2. You can disable anonymous access to your web application and required
Integrated Windows Authentication. Then in your web.config file, set
<identity impersonate="true" /> and make sure the users calling your web
application have permissions to the file you want to access.

HTH,
Mark Jen [MSFT]
--
Please reply in newsgroup.
This posting is provided "AS IS" with no warranties, and confers no rights.

Yama said:
Hi,

Is there a way using an Intranet ASP.NET web application to access a text file from a specified folder?

The Logic:

ReadTextFile.aspx
--------------------
FILE = "a_comma_delimited_text_file.txt"
PATH = "C:\folder\subfolder\"
ACCESS = PATH+FILE
Open for READONLY.
Save it to SQL2000 database
--------------------
When someone in the organiztion connected to the network access this page:
1) Is it possible for my ASPX page to read the FILE?
2) Is there a permission that can be administered to make it work?
3) Can ACCESS = PATH+FILE be a folder on every computer in my
organization an accessible folder from my REadTextFile.aspx?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top