473,383 Members | 1,815 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

ASP Virtual Directory GetFolder Error

Hi,

We have a webpage browsing folders within the wwwroot. We need to
access a remote shared directory the same way.

We created a virtual directory in IIS with an alias pointing on this
remote directory. The virtual directory is accessible when we type it
in the address bar of IE but when we try accessing it with a
Scripting.FileSystemObject.

I wonder what is missing or what we are doing wrong.

Accessible :
http://<server-name>/<alias>
(I can browse the directory, download files, etc)

Not accessible :
Set fsoFolder = objFSO.GetFolder(Server.MapPath("<alias>"))
or
Set fsoFolder = objFSO.GetFolder("\\<remote-server-name>\<remote-
directory>")
or
Set fsoFolder = objFSO.GetFolder("http://<server-name>/<alias>")

When I tried these I got :

Server object error 'ASP 0177 : 800a004c'

Server.CreateObject Failed

/xslamweb/test-website/asp/xdsl_test.asp, line 43

The operation completed successfully

43 Set fsoFolder = objFSO.GetFolder(Server.MapPath("../../Ltdocs/"))

Can you please help me solve this problem.

Decoy

Jun 14 '07 #1
4 9068

<ls******@gmail.comwrote in message
news:11*********************@x35g2000prf.googlegro ups.com...
Hi,

We have a webpage browsing folders within the wwwroot. We need to
access a remote shared directory the same way.

We created a virtual directory in IIS with an alias pointing on this
remote directory. The virtual directory is accessible when we type it
in the address bar of IE but when we try accessing it with a
Scripting.FileSystemObject.

I wonder what is missing or what we are doing wrong.

Accessible :
http://<server-name>/<alias>
(I can browse the directory, download files, etc)

Not accessible :
Set fsoFolder = objFSO.GetFolder(Server.MapPath("<alias>"))
or
Set fsoFolder = objFSO.GetFolder("\\<remote-server-name>\<remote-
directory>")
or
Set fsoFolder = objFSO.GetFolder("http://<server-name>/<alias>")

When I tried these I got :

Server object error 'ASP 0177 : 800a004c'

Server.CreateObject Failed

/xslamweb/test-website/asp/xdsl_test.asp, line 43

The operation completed successfully

43 Set fsoFolder = objFSO.GetFolder(Server.MapPath("../../Ltdocs/"))

Can you please help me solve this problem.

Decoy
The problem is that when you create the alias on a UNC path IIS would have
asked you to enter some domain credentials that it will use when attempting
to access the folder. Hence instead of using the IUSR_<machinenamewhen
accessing anything in the alias folder IIS will use the provided
credentials.

Other code in your website won't benefit from this behaviour hence
attempting to use FSO to open the remote folder fails because the current
user underwhich the script is running doesn't have access to the folder.

Note also parent paths "../../" are disabled by default in IIS6.

The only simple solution I know of is to change the anonymous user account
to a domain account that has been granted access to the share. You can
limit this change to this one ASP page if you prefer.


Jun 14 '07 #2
Unfortunatly, this alternative seem to displease the security audit
department.

I tried as an alternative solution to map a drive from the webserver
to the fileserver. It worked fine, I can call objFSO.GetFolder("v:\"),
but as soon as I logoff, the drive is no longuer available.

Is there a way to create a permanent mapped drive ?

Jun 14 '07 #3

<ls******@gmail.comwrote in message
news:11********************@x35g2000prf.googlegrou ps.com...
Unfortunatly, this alternative seem to displease the security audit
department.

I tried as an alternative solution to map a drive from the webserver
to the fileserver. It worked fine, I can call objFSO.GetFolder("v:\"),
but as soon as I logoff, the drive is no longuer available.

Is there a way to create a permanent mapped drive ?
Not that I know of but those clever guys in the security audit dept might
know?

You might ask them to justify their reasons for their 'displeasure' since I
see no reason why a single page that needs access to a file share shouldn't
be granted access to the file share. Utlimately for the app to work some
way to enable this has to be found. Since the solution I offered doesn't
open up holes to anywhere else I don't see their problem. I suspect they
haven't understood the requirement or the limited scope of access we are
talking about.

Are your users internal (IOW, are your users managed but the same security
audit dept that manages the server).

If so perhaps they can place all the users that require access to the remote
folder in a Group and grant that group the appropriate rights on the share
and folder contents. Turn off anonymous access on the ASP pages and turn on
windows integerated. Make sure each user has the server name added to their
browsers Intranet Zone which allows automatic use of NTLM. (In Firefox use
about:config setting network.automatic-ntlm-auth.trusted-uris).

Now when the users hit that page they will be automatically authenticated
and the ASP script will run under their security token. Since they've been
granted access the remote folder the FSO code will work.

However utlimately my original recommendation still stands, you need to make
the security audit deptarment accountable by asking for definitive reasons.

Jun 15 '07 #4
I think I get you all wrong the first time.

I will try your solution. The only problem I see is that my hands are
tied by a complex ticket system I need to wait for an IT guy to do it.

Thanks for your help.

Jun 15 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: bart plessers | last post by:
Hello, Currently I am developping a internet "directory browser" My page 'default.asp' has following entries: CurrentPATH = Request("MyLink") Set oFSO =...
3
by: Kay | last post by:
IIS cannot read files in a directory reporting that : Microsoft VBScript runtime (0x800A01B6) Object doesn't support this property or method: 'Fso.GetFolder' This has to do with...
7
by: Jaydeep | last post by:
Hi, Anybody knows how to create virtual directory programmatically under root directory ofcourse from code-behind. I am developing web-based application where I need to create a folder and making...
5
by: Stu Carter | last post by:
Hi, ENV: Windows 2003 Server SP1 (+all updates), VS 2003, .Net 1.1 SP1 We've got an ASP.Net web application using State Service. All is fine until we tried to use the app through a virtual...
1
by: Dave | last post by:
I am getting te following error in a ASP.Net app that is running on Win XP Pro (SP2): Server cannot access application directory 'C:\Documents and Settings\dave\My Documents\My Visual Studio...
8
by: Nate | last post by:
I am running on Window 2003. I have a website built in ASP.NET 2.0. I need to have a Virtual Directory running an application in 1.1. I have configured each in its own Application Pool. The 1.1...
2
by: tshad | last post by:
I have set up a Virtual Directory underneath my normal Web Site in IIS 6 for 2 of our sites. One of them works file. The other one is giving me an error:...
12
by: Pao | last post by:
Hi all For all NEW sites (virtual directories) that I create, I receive always the same error: (I translate so may be a little different) Impossible to visualize the XML page Impossible to...
1
by: jbonifacejr | last post by:
I am unable to use the GetFolder method of the FileSystem object when trying to get the folders from within a Virtual Directory. Here is my setup... I have a Development Box (DB) and a...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.