471,108 Members | 1,557 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,108 software developers and data experts.

Need to read a text file from a network share

Ok, I'm brand new to IIS and asp. (My experience is with apache on Solaris but we have gotten rid of that system.) I need to readin a text file with asp that is on the C: drive of another Windows server that is not running IIS. I created a share on folder containing the text file on the second server and made it available to the Everyone Group.

The asp program, which works when the file is local, doesn't work when I modify the Server.MapPath line to use an UNC.

Expand|Select|Wrap|Line Numbers
  1. DispFile= Server.MapPath("\\\\ArcGISLicenseLog\\ESRILicenseUse.txt")
  2. 'DispFile= Server.MapPath("ESRILicenseUse.txt")
  3. Set FileObject = Server.CreateObject("Scripting.FileSystemObject") 
  4. Set InStream = FileObject.OpenTextFile (DispFile) 
From what I've read Server.MapPath doesn't work with those. How do I read a text file from a network share and is there any special permissions needed on the network share beyone the Everyone group?

Dec 10 '10 #1
2 3557
Try mapping the network drive.
Dec 10 '10 #2
321 Expert 100+
I don't know for sure what problems you are going to run into as I haven't tried it and don't have the right environment to test, but here's my two cents:

1) FSO does have the ability to open UNC paths as stated here. However, you may or may not have issues using the IUSR_MACHINENAME or whatever account your site is running under accessing the other computer, just have to try and see.

2) Server.MapPath shouldn't need to be used, you are already specifying the full path which is all that function returns.

3) You should only have "\\" at the beginning of the UNC path, not after the folders.
Dec 11 '10 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by rishka | last post: by
2 posts views Thread by Tim2Be | last post: by
1 post views Thread by sallu2000 | last post: by
6 posts views Thread by portCo | last post: by
5 posts views Thread by dm3281 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.