|
 |
asp_web_howto thread: connecting to text data file from IIS server
Message #1 by "Eva Olak" <ewa.olak@j...> on Thu, 12 Sep 2002 18:56:31
|
|
Hello,
I am new to ASP and IIS server.
In my code I have a line of code that reads:
set TheTextStream = objFileSys.OpenTextFile
("c:\inetpub\wwwroot\webproject\PIXEL.txt", 1)
The text data file is located physically on IIS server computer in
c:\inetpub\wwwroot\webproject folder.
Everything works file when the data file resides in the same folder as the
rest of asp pages that read the data file.
The problem is that the real data will reside on one of the network drives
physically on different file server.
Would somebody give me a hint how to change the code so I can connect to
the proper network drive folder and open the text file mentioned above.
Thanks
Eva
Message #2 by "phil griffiths" <pgtips@m...> on Fri, 13 Sep 2002 11:33:36
|
|
Hi Eva,
You can create a virtual directory in IIS config, beneath your root
folder, that gets content from the network directory. e.g. if you name
it 'external' you just use
set TheTextStream = objFileSys.OpenTextFile
(Server.MapPath("external/PIXEL.txt"), 1)
You need to sort out permissions before you will be able to open the file.
By default the "anonymous" user which IIS uses is a local account only
known to the IIS server. The other server on which pixel.txt resides will
not know anything about this user and so will not give it permission to
open the file. The usual way to get around this is change the anonymous
user to a (new) domain user and ensure this new user has permission to
read the file from the other server.
hth
Phil
>-----------------------------------------------------
Hello,
I am new to ASP and IIS server.
In my code I have a line of code that reads:
set TheTextStream = objFileSys.OpenTextFile
("c:\inetpub\wwwroot\webproject\PIXEL.txt", 1)
The text data file is located physically on IIS server computer in
c:\inetpub\wwwroot\webproject folder.
Everything works file when the data file resides in the same folder as the
rest of asp pages that read the data file.
The problem is that the real data will reside on one of the network drives
physically on different file server.
Would somebody give me a hint how to change the code so I can connect to
the proper network drive folder and open the text file mentioned above.
Thanks
Eva
Message #3 by "Eva Olak" <ewa.olak@j...> on Fri, 13 Sep 2002 14:59:27
|
|
Thanks Phil. As I understand I need to create virtual directory
named 'external' or something like that under 'wwwroot' and map it to the
shared network drive for example p:\external where pixel.txt is located.
Then in APS code, as you pointed out, use Server.MapPath....
I will try that.
Thx again
Eva
----------
> Hi Eva,
> You can create a virtual directory in IIS config, beneath your root
f> older, that gets content from the network directory. e.g. if you name
i> t 'external' you just use
s> et TheTextStream = objFileSys.OpenTextFile
(> Server.MapPath("external/PIXEL.txt"), 1)
> You need to sort out permissions before you will be able to open the
file.
B> y default the "anonymous" user which IIS uses is a local account only
k> nown to the IIS server. The other server on which pixel.txt resides
will
n> ot know anything about this user and so will not give it permission to
o> pen the file. The usual way to get around this is change the anonymous
u> ser to a (new) domain user and ensure this new user has permission to
r> ead the file from the other server.
> hth
P> hil
>> -----------------------------------------------------
H> ello,
> I am new to ASP and IIS server.
I> n my code I have a line of code that reads:
> set TheTextStream = objFileSys.OpenTextFile
(> "c:\inetpub\wwwroot\webproject\PIXEL.txt", 1)
> The text data file is located physically on IIS server computer in
c> :\inetpub\wwwroot\webproject folder.
E> verything works file when the data file resides in the same folder as
the
r> est of asp pages that read the data file.
> The problem is that the real data will reside on one of the network
drives
p> hysically on different file server.
W> ould somebody give me a hint how to change the code so I can connect to
t> he proper network drive folder and open the text file mentioned above.
> Thanks
E> va
Message #4 by Vijay G <happygv@y...> on Fri, 13 Sep 2002 07:20:49 -0700 (PDT)
|
|
Hi Eva,
Check your system on which IIS is running, There should be Users with id...
IUSR_<YOUR_MACHINE_NAME> and I_WAM......
Try to give permission for these two users on the other system for those files you need to access thru IIS page.
The other way is, If your IIS server runs on a PDC, then create a User on the domain, for only accessing this and for this
particular page, donot give anonymous, and give the user u have created in that domain.... before which you should give necessary
permissions for that user on the other server in which the pixel.txt resides. it is better you give to that file alone, or in case
you wanna access many files from that location, you can do it for the entire folder.
Please let me know if that works.
Cheers!!!
--Vijay G
phil griffiths
wrote:Hi Eva,
You can create a virtual directory in IIS config, beneath your root
folder, that gets content from the network directory. e.g. if you name
it 'external' you just use
set TheTextStream = objFileSys.OpenTextFile
(Server.MapPath("external/PIXEL.txt"), 1)
You need to sort out permissions before you will be able to open the file.
By default the "anonymous" user which IIS uses is a local account only
known to the IIS server. The other server on which pixel.txt resides will
not know anything about this user and so will not give it permission to
open the file. The usual way to get around this is change the anonymous
user to a (new) domain user and ensure this new user has permission to
read the file from the other server.
hth
Phil
>-----------------------------------------------------
Hello,
I am new to ASP and IIS server.
In my code I have a line of code that reads:
set TheTextStream = objFileSys.OpenTextFile
("c:\inetpub\wwwroot\webproject\PIXEL.txt", 1)
The text data file is located physically on IIS server computer in
c:\inetpub\wwwroot\webproject folder.
Everything works file when the data file resides in the same folder as the
rest of asp pages that read the data file.
The problem is that the real data will reside on one of the network drives
physically on different file server.
Would somebody give me a hint how to change the code so I can connect to
the proper network drive folder and open the text file mentioned above.
Thanks
Eva
---------------------------------
Do you Yahoo!?
Yahoo! News - Today's headlines
|
|
 |