[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now


ASP FileSystemObject works clientside but not server side

Posted on 2004-04-15
Medium Priority
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
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

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.

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 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):



Accepted Solution

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

Community Support Moderator

Featured Post


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

650 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