[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 403
  • Last Modified:

ASP FileSystemObject works clientside but not server side

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."
     else
          strMsg="The following Job Folder Does Exist."
     end if

end sub

</script>

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' />"
     else
          response.write "<img src='/images/red_x.gif' alt='Job Folder Does NOT Exists'/>"
     end if

Loop

Thanks is advance.  Any assistance is appreciated.
0
ida-intl
Asked:
ida-intl
1 Solution
 
mrGreenCommented:
could experiment with this bit:

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

try using the full physical path with drive letter.

cheers

Matt
0
 
mrGreenCommented:
or firstly write out strJobFolder to the page to see what is returning
0
 
ida-intlAuthor Commented:
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.

0
Technology Partners: 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!

 
mouattsCommented:
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.
Steve
0
 
ida-intlAuthor Commented:
Steve,

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

http://support.microsoft.com/default.aspx?scid=kb;EN-US;283201



0
 
moduloCommented:
PAQed with no points refunded (of 50)

modulo
Community Support Moderator
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now