469,612 Members | 1,674 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,612 developers. It's quick & easy.

Accessing a TEXT file

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

Nov 18 '05 #1
1 1340
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/de...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" <an*******@discussions.microsoft.com> wrote in message
news:06**********************************@microsof t.com...
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?
I'd appreciate your input.

Sincerely,

Yama Kamyar
Sr. Micorsoft .NET Consultant

Nov 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

23 posts views Thread by Lamberti Fabrizio | last post: by
6 posts views Thread by Chris Styles | last post: by
5 posts views Thread by Daniel Corbett | last post: by
reply views Thread by Dana | last post: by
8 posts views Thread by GaryDean | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.