Solved

Using UNC to access a file from IIS

Posted on 1998-09-09
6
263 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
Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

 
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

Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Code Manager | Snippits 2 93
Record locking on classic ASP 3 64
Cannot access website or email server 4 86
transfer content to new site design 7 49
When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

739 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