File Exists Error => Please Help!!

Results 1 to 4 of 4

Thread: File Exists Error => Please Help!!

  1. #1
    Andy Tabar Guest

    Default File Exists Error => Please Help!!

    What is wrong with this when PageName is equal to mypage:<BR><BR>&#060;% <BR>Set fso = CreateObject("Scripting.FileSystemObject") <BR>If fso.FileExists("d:inetpubwwwrootwocketwwwpages\") & (PageName) & (".asp") Then <BR> body = "/pages/mypage.asp" <BR>Else <BR> body = "404 Error: File doesn&#039;t exist." <BR>End If <BR><BR>Server.Execute(body) %&#062; <BR><BR>I get this error:<BR><BR>Error Type: <BR>Microsoft VBScript runtime (0x800A000D) <BR>Type mismatch: &#039;[string: "Falsemypage.asp"]&#039; <BR>/future.asp, line 199 <BR><BR>any ideas? thanks. i appreciate any help. <BR><BR>~andy

  2. #2
    Join Date
    Dec 1969

    Default RE: File Exists Error => Please Help!!

    don&#039;t know if this is the only source of the problem, but right off the bat, the following line looks a little funky to me:<BR><BR>If fso.FileExists("d:inetpubwwwrootwocketwwwpages\") & (PageName) & (".asp") Then<BR><BR>try it as:<BR><BR>If fso.FileExists("d:inetpubwwwrootwocketwwwpages\" & PageName & ".asp") Then

  3. #3
    Andy Tabar Guest

    Default Hmmm...Well...

    Hey ...thanks...<BR><BR>I think that fixed that error. But now I ge this error:<BR><BR>Error Type:<BR>Server object, ASP 0231 (0x80004005)<BR>Invalid URL form or fully-qualified absolute URL was used. Use relative URLs.<BR>/future.asp, line 205<BR><BR>On line 205 is this:<BR><BR>&#060;% Server.Execute(body) %&#062;<BR><BR>What can I try instead? here is the snippet in all:<BR><BR>&#060;% <BR>Set fso = CreateObject("Scripting.FileSystemObject") <BR>If fso.FileExists("d:inetpubwwwrootwocketwwwpages\" & PageName & ".asp") Then<BR> body = "d:inetpubwwwrootwocketwwwpagesmypage.asp"<BR> Else <BR> body = "404 Error: File doesn&#039;t exist." <BR>End If <BR> <BR>Server.Execute(body) %&#062;<BR><BR>thanks<BR><BR>~andy<BR><BR>

  4. #4
    Join Date
    Dec 1969

    Default Why the repost?

    i answered your question on the Asp Q&A forum. not only is this a repost but it is also a cross post, see the faqs on why this is bad.

Posting Permissions

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