Ask a questionAsk a question
 

Questionfilesystemobject Filexists always returns false

  • Tuesday, November 03, 2009 5:08 AMKrishna Rao bashaboiina Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Has Code
    Hi ,

    I need to check whether file exists in the folder in the server side.  Fso.FileExists always returns false irrespective of file exists.  In the code M is the Mapped drive.  IIS User has full permissions on the mapped drive.  Please help me in solving the problem.


    <%
    Set fso = Server.CreateObject("Scripting.FileSystemObject")
    sPathWithoutExt = "M:\\" & Request("order_no") & "\\" & Request("order_no")
            If fso.FileExists(sPathWithoutExt & ".pdf") Then
                    sPath = "http://www.testsite.com/images/" & Request("order_no") & "/" & Request("order_no")& ".pdf"
            Else
                    spath = "http://www.testsite.com/images/" & Request("order_no") & "/" & Request("order_no")& ".tif"
            End If
    
            Set fso = Nothing
    %>


    krishna Rao
    • Moved byJeff ShanMSFTWednesday, November 04, 2009 7:10 AMoff topic (From:Visual Basic General)
    •  

All Replies

  • Wednesday, November 04, 2009 7:09 AMJeff ShanMSFTUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    Hi
    This forum is for VB.NET questions only (e.g. Visual Basic 2003, Visual Basic 2005, Visual Basic 2008).

    Sticky: For Visual Basic 6 questions, please read...

    Sticky: For VBA, Office (VSTO), Macros and VBScript Questions

    For VBA (Visual Basic for Applications), Macros or Excel Questions, you will get better support in the VBA Forum:

    http://social.msdn.microsoft.com/forums/en-US/isvvba/threads/

    For developing add-ins for Office 2003 or 2007 products:
    Visual Studio Tools for Office

    http://social.msdn.microsoft.com/forums/en-US/vsto/threads/

    For VBScript questions, you will get better support at related forums to VBScript.
    http://www.visualbasicscript.com/ (A Non-Microsoft Site)

    http://www.microsoft.com/communities/newsgroups/list/en-us/default.aspx?dg=microsoft.public.scripting.vbscript VBScript
    Newsgroup Discussion

    Thanks for your understanding and support!

    Best Wishes
    Jeff Shan


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.