Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Using UNC to access a file from IIS

Posted on 1998-09-09
6
Medium Priority
?
265 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
Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

 
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 100 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

Looking for a new Web Host?

Lunarpages' assortment of hosting products and solutions ensure a perfect fit for anyone looking to get their vision or products to market. Our award winning customer support and 30-day money back guarantee show the pride we take in being the industry's premier MSP.

Question has a verified solution.

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

CTAs encourage people to do something specific to show interest in your company, product or service. Keep reading to learn why CTAs should always be thought of as extremely important, albeit small, sections of websites.
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
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…
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.
Suggested Courses

670 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