Results 1 to 3 of 3

Thread: FileExists

  1. #1
    Join Date
    Dec 1969

    Default FileExists

    Hello All,<BR><BR>The if statement (below) is always false.<BR><BR>does exist and the Session var SELECTUNIT = SP114. The response.write&#039;s tell me so. Why is the if failing?<BR>Please Help.<BR><BR>The asp code:<BR><BR>&#060;%<BR><BR>var Image;<BR>var fso, fl;<BR>Response.Write(Application("PHOTO") + Session("SELECTUNIT") + "p1t.jpg");<BR>fso = new ActiveXObject("Scripting.FileSystemObject");<BR>fl = Application("PHOTO") + Session("SELECTUNIT") + "p1t.jpg";<BR>Response.Write(fl);<BR>if (fso.FileExists(fl)) {<BR> Response.Write("exists");<BR> Image = (Application("PHOTO") + Session("SELECTUNIT") + "p1t.jpg"); <BR>} else {<BR> Response.Write("no image");<BR><BR> Image = (Application("NOIMAGE")); <BR> }<BR> <BR> Response.Write("&#060;td rowspan=10 width=\"20%\"&#062;");<BR> Response.Write("&#060;img src=\"" + Image + "\"&#062;");<BR> <BR>%&#062; <BR><BR>and part of the global.asa:<BR><BR>Application("PHOTO")= "";<BR><BR>

  2. #2
    KPW Guest

    Default RE: FileExists

    The FileExists method works using physical paths, not virtual paths. I don&#039;t see anywhere here where you get the physical path to the file.

  3. #3
    Join Date
    Dec 1969

    Default Thank You!! It Works!

    That works!! Thank you very much!!

Posting Permissions

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