ASP FileSystemObject works clientside but not server side

Posted on 2004-04-15
Last Modified: 2012-06-27
I am using ASP to develop an internal Intranet on IIS 5.0 on SBS2000.  Understanding most of the differences, I do my development/testing on an XP pro machine running IIS.   My clients are using XP Pro w/ IE 6.0.  All machines have the latest security updates.  My file system is on SBS2000 (all clients have r/w access to the share I reference in the below script).  I am using Windows authentication, not Anonymous, on the Intranet web site.

I am testing new functionality to validate if folders exist on our shared drive (\\usidafs02\shared\).  I am using the fso.FolderExists method on two different ASP pages.

The first, is in a client side script to validate if a folder exists.  This works fine.

<script language="vbscript">

sub button_action()

     dim fso
     Set fso = CreateObject("Scripting.FileSystemObject")
     strRootFolder="\\usidafs02\shared\IDA Jobs\Active\"
     strJobFolder= document.jobedit.jobname.value & " (" & document.jobedit.jobnumber.value & ")"
     if fso.FolderExists(strRootFolder & strJobFolder) = False then
          strMsg="The following Job Folder Does NOT Exist."
          strMsg="The following Job Folder Does Exist."
     end if

end sub


The second page uses fso.FolderExists in a serverside script to validate a list of folders(individually) and display a summary page showing whether or not they exist.  I can execute this from IE on the dev server (WinXP Pro) and it works, but when I execute it from one of the clients machines, it always returns false.

Here is the scaled down version...

Do while (Not oRsJobList.eof)

     response.write oRsJobList("JobName")

     dim fso
     Set fso = server.createobject("Scripting.FileSystemObject")

     strRootFolder="\\usidafs02\shared\IDA Jobs\Active\"
     strJobFolder= oRsJobList("JobName") & " (" & oRsJobList("JobNo") & ")"
     strFolderExists=fso.FolderExists(strRootFolder & strJobFolder)

     If strFolderExists Then
          response.write "<img src='/images/green_check.gif' alt='Job Folder Does Exists' />"
          response.write "<img src='/images/red_x.gif' alt='Job Folder Does NOT Exists'/>"
     end if


Thanks is advance.  Any assistance is appreciated.
Question by:ida-intl

Expert Comment

ID: 10834819
could experiment with this bit:

strRootFolder="\\usidafs02\shared\IDA Jobs\Active\"

try using the full physical path with drive letter.



Expert Comment

ID: 10834829
or firstly write out strJobFolder to the page to see what is returning

Author Comment

ID: 10834965
I added the following to my code...

1st pass...
strRootFolder="s:\IDA Jobs\Active\"
response.write strFolderExists & "&nbsp"
response.write strRootFolder & strJobFolder & "\"

2nd pass...
strRootFolder="\\usidafs02\shared\IDA Jobs\Active\"
response.write strFolderExists & "&nbsp"
response.write strRootFolder & strJobFolder & "\"

When run in IE on the dev server...

1st pass...
     True - s:\IDA Jobs\Active\Giant Foods (04-020)\
2nd pass...
     True - \\usidafs02\shared\IDA Jobs\Active\Giant Foods (04-020)\

When run in IE on the client XP box...

1st pass...
     False - s:\IDA Jobs\Active\Giant Foods (04-020)\
2nd pass...
     False - \\usidafs02\shared\IDA Jobs\Active\Giant Foods (04-020)\

I even copied and pasted the full path into Start \ Run on the client machine and it brings me to the folder in explorer.

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

LVL 11

Expert Comment

ID: 10835256
Can you confirm that if you access this page on the server with a browser that it works. If not then the account that the web server is running under does not have access to the share.
If you can see it this way but not from the other clients accessing it via a browser on your server then sounds to me as though the accounts that other people are using do not have permissions to the shared drive.

Author Comment

ID: 10836259

I believe you're right in that it is a permissions issue, but I'm not sure that I fully understand what is happening from a permission standpoint.

Here is my understanding of how the fso object works...(and please correct me if I'm wrong)

I'm assuming that the client side script runs fine on my dev server when executed from a client workstation b/c the fso object is created by the authenticated windows user who is executing it...and since the authentiated windows user has access to the shared drive on my production server, the FolderExists method works fine.

When a client workstation executes the server side script on my dev server, the fso object is created by the dev servers 'local' IUSR_machinename account for the fso operations and since this account doesn't have access to this share on my production server the method fails.

When I copied the server side script page to my production server they executed fine from a client workstation.  I'm assuming this is b/c IIS and the file share reside on the same server and the production IUSR_machinename account is part of the 'users' group, which has access to the share.

If this is true...
     1) why am I able to execute the server side fso from IE on my dev box and not on any other client machine?
     2) is it possible to set permissions so my dev server can access the shares on my production server? (I can't give permissions to the dev machines 'local' IUSR_machinename account on my production server that I know of)
LVL 15

Expert Comment

ID: 10841047
This, I think, is not a permissions issue but the dreaded 'delegation' problem when using Windows Authentication via IIS. IIS is unable to pass the authentication credentials of the logged on user to ANY other machine on the network. This is a known limitation of Windows Integrated Authentication.

If your servers are Win2k or Win2k3 and run Active Directory you can work around the delegation problem.

Here is an MSDN article to get you started (it doesn't deal with file system access but the solution should - hopefully - still work for you):;EN-US;283201


Accepted Solution

modulo earned 0 total points
ID: 12693982
PAQed with no points refunded (of 50)

Community Support Moderator

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How can i convert a Generic list to DataTable in c# 3 1,018
Copy only dates 3 88
Question about ASP Including Files 6 58
rebind a grid after user clicks on node in treeview 1 35
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: and…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

776 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