Solved

Using UNC to access a file from IIS

Posted on 1998-09-09
6
262 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
QQ problem 22 63
Passing client data from form to server 5 17
Display if field is NOT "" or NOT null 6 22
javascript form - error when hitting enter 3 27
Get to know the ins and outs of building a web-based ERP system for your enterprise. Development timeline, technology, and costs outlined.
Although a lot of people devote their energy toward marketing for specific industries, there are some basic principles that can be applied to any sector imaginable. We’ll look at four steps to take and examine how those steps were put into action fo…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
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…

762 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