FileSystemObjects FileExists can't find a fil

Results 1 to 2 of 2

Thread: FileSystemObjects FileExists can't find a fil

  1. #1
    Ron Brown Guest

    Default FileSystemObjects FileExists can't find a fil

    Hello,<BR><BR>Is there some problem with the FileSystemObjects running in IIS4 under Windows NT 4 sp 6 when long file names are used?<BR><BR>I realize that you probably don&#039;t troubleshoot peoples code, but after incorporating some elements I found in your FAQ on the FileSystemObject methods MapPath and FileExists FileSystemObjects. I found that they were unable to find the following file:<BR><BR>nbiweb/accting/Reports/MonthlySummary/PDFs/00-11/Item%201%201000.pdf<BR><BR>If I give IE5 the adobe reader will display this file.<BR><BR>From my networked system, I can also access the file from the Web-Server directly as:<BR><BR>\NETADMINDInetPubwwwroot
    biwebacctingReportsMonthlySummaryPDFs0-11Item 1 1000.pdf<BR><BR>Entering this path into the Windows Explorer also brings up the file in Adobe Reader.<BR><BR>However using the below code I never get a True value, when this function is given the first path.<BR><BR>Here is the function I built based on your FAQ article:<BR>Function DocExists( sDocName )<BR> Dim oFSObj<BR> Dim sFileName<BR><BR> sFileName = server.mappath( sDocName )<BR> Set oFSObj = Server.CreateObject( "Scripting.FileSystemObject" )<BR> DocExists = oFSObj.FileExists( sFileName )<BR><BR> Set oFSObj = Nothing<BR><BR>End Function Rem DocExists<BR><BR>Thank you,<BR>Ron Brown<BR><BR>Please respond via

  2. #2
    Ron Brown Guest

    Default RE: FileSystemObjects FileExists can't find a

    The problem I was having with the FileExist FileSystemObject Method had to do with file permissions. It turned out that the Web-Server accounts didn&#039;t have permissions to read these files. So FileExist, run locally on the web-server, couldn&#039;t see the file until I gave it read access to the directory and files!<BR><BR>There is a directory List permission in NTFS, but not for the files. This appears to mean that if only some users are supposed to read certain files, you can&#039;t grant the web-server read access to those files. When I did that I could, access the files by typing in their URLs on any other system as any user. It as if this gave them a proxy.<BR><BR>The only alternative I can see is to use the directory list privilege and scan the directory contents, one at a time, until the a match is found or all the names have been read. Not the most elegant method!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts