(ASP101) View code script

Results 1 to 5 of 5

Thread: (ASP101) View code script

  1. #1
    Joe Schmoe Guest

    Default (ASP101) View code script

    I took some code from ASP101 so people can view my code. I can get it to work on my own network but I cannot use it on brinkster. So Im hoping someone can help me with this<BR><BR>&#039; Get file name from query string<BR>strASPFileName = Request.QueryString("file")<BR><BR>&#039; Conditional limiting use of this file to current directory<BR>If InStr(1, strASPFileName, "\", 1) Then strASPFileName = ""<BR>If InStr(1, strASPFileName, "/", 1) Then strASPFileName = ""<BR><BR>&#039; Set the default so it shows itself if nothing or an invalid<BR>&#039; path is passed in. Delete the following line to just display<BR>&#039; a message.<BR>If strASPFileName = "" Then strASPFileName = "joe.asp"<BR><BR>If strASPFileName &#060;&#062; "" Then<BR> Set objFSO = CreateObject("Scripting.FileSystemObject")<BR> Set objInFile = objFSO.OpenTextFile("JoeSchmoe\" & strASPFileName)<BR><BR>I *think* the problem is with that last line. it works with the full path such as: ("c:InetPubwwwrooted_arch\" & strASPFileName). So my question is can/should I use http://www21.brinkster.com/JoeSchmoe or do I need to ask brinkster for the full path?<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: (ASP101) View code script

    objFSO.OpenTextFile(server.mappath(strASPFileName) ) if this asp file is in the same directory as straspfilename otherwise<BR><BR>objFSO.OpenTextFile(server.mappat h("relativepath" & strASPFileName))<BR><BR><BR><BR>

  3. #3
    Joe Schmoe Guest

    Default HA! Thanks F/Krank <eop>

    Thanks F/Krank

  4. #4
    Join Date
    Dec 1969

    Default Krank is right ...

    That is the best way to do it. If you really want to see the full path though, you could look at Request.ServerVariables("PATH_TRANSLATED")

  5. #5
    F/Krank Guest

    Default You got me pegged

    so much for staying anonymous with the clever disguise I applied to my name

Posting Permissions

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