Solved

Using UNC to access a file from IIS

Posted on 1998-09-09
6
258 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
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 create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

760 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now