Solved

Using UNC to access a file from IIS

Posted on 1998-09-09
6
260 Views
Last Modified: 2013-12-25
Hi,

I am writing an ASP application. In my global.asa, I create an ActiveX control (that I developed) using:

<OBJECT
RUNAT=SERVER SCOPE=Session ID=MyObject PROGID="MyObject.MyInterface">
</OBJECT>

The object tries to access a file on the server.
If the file is referenced using the local path
(like: c:\my documents\myfile.txt), then the file can
be properly accessed.

When I try to access the file using the UNC name
(like \\myserver\c\my documents\myfile.txt), then
the file cannot be seen.

I have the feeling that this has to do with permissions
on my NT server. I know that when using IIS 3.0, the server
is accessed via the IUSR_MACHINE_NAME account. I have made sure that this account has the same password under IIS and under NT server. I also made sure that this user has the right privileges to this directory.

However, the fact that using the local path works seems to indicate that permissions on that path are not the problem.

Any ideas?
thanks,
Ralph.
0
Comment
Question by:rakhras
  • 2
  • 2
  • 2
6 Comments
 
LVL 4

Expert Comment

by:mcix
ID: 1854883
Have you looked into the MapPath Method?
0
 

Author Comment

by:rakhras
ID: 1854884
No. It's a method of which object?
0
 
LVL 4

Expert Comment

by:mcix
ID: 1854885
MapPath is a method of the ASP Server Object.  It may not help what you are trying to do, but it may get you going in the right direction...

Look here for some basic info:

http://www.microsoft.com/iis/support/iishelp/iis/htm/asp/intr98iw.htm
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
LVL 10

Expert Comment

by:MasseyM
ID: 1854886
mcix is correct about the map path method... There is no way to use the virtual path when accessing a file, but hte Map Path function will give you the physical path to your server and then you can admend that to the filename & directory structure.

Another way is to map a drive to the directory that you are wanting to access and then use that physical drive in you call...

0
 

Author Comment

by:rakhras
ID: 1854887
I just found an article in the MS Knowledge base that says
that UNC are not supported ...

Here's an excerpt:

   Network paths such as UNC's should work for Basic / Anonymous access,
   but they do not work when you use the updated JET driver under IIS 4.0.
   This is because the user security context is switched to SYSTEM when it
   reads the database. The system account cannot access networked
   resources. Move the database to the Web server and use a local path. For
   Visual InterDev to work from a remote workstation in this situation, set
   up the system DSN's as described in the Microsoft Knowledge Base article
   listed in the REFERENCES section. The article was written to show how to
   work around delegation problems on authenticated projects, but the fix
   is applicable to this problem also.
0
 
LVL 10

Accepted Solution

by:
MasseyM earned 50 total points
ID: 1854888
UNC are not supported by ASP.  You will have to use the mappath method to get the Host physical path then admend your path to that...

0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
The viewer will learn how to dynamically set the form action using jQuery.

809 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