Checking if page exists

Results 1 to 4 of 4

Thread: Checking if page exists

  1. #1
    Corin Guest

    Default Checking if page exists

    I use the following to let a user create a page<BR><BR>set filesys=server.createobject("scripting.filesystemo bject")<BR> set txtfile=filesys.CreateTextFile(FileName)<BR> txtfile.Write(VarHTML )<BR><BR>What I need help with is how to check to be sure the file name deoesn&#039t already exist, if it does let the user know and give them the option to overwrite or cancel.<BR><BR>Thanks in advance

  2. #2
    E! Guest

    Default RE: Checking if page exists

    There is a FileExists method for FSO... Check that out...<BR><BR>You will need an if...then...

  3. #3
    sfsf Guest

    Default RE: Checking if page exists

    in vb<BR> Dim objFileSystemObject As Object<BR> Dim vTextFile As Variant<BR> <BR> Set objFileSystemObject = CreateObject("Scripting.FileSystemObject")<BR> <BR> &#039 if the file doesn&#039t exist then create it<BR> If Not ((objFileSystemObject.FileExists(mk_sJobProfilesFi lePath))) Then<BR> <BR> Set vTextFile = objFileSystemObject.CreateTextFile(mk_sJobProfiles FilePath, True)<BR> vTextFile.WriteLine (mk_sFileMessage)<BR> vTextFile.Close<BR> End If<BR> <BR> Set objFileSystemObject = Nothing

  4. #4
    E! Guest

    Default What if...

    the file does exist? you need an else in there to redirect them back to the page where they name the file to be created...

Posting Permissions

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