Results 1 to 2 of 2

Thread: Server.MapPath

  1. #1
    Join Date
    Dec 1969

    Default Server.MapPath

    I want to open a text file depending upon a users request but I cant figure out how to do this.<BR>Instead of stating the file that I want opend like this:<BR><BR>set objTS = objFS.OpenTextFile(Server.MapPath("myfile.txt"), _<BR> ForReading)<BR><BR>I want to do something like this, which doesnt work:<BR>page = request.querystring("page")<BR>set objTS = objFS.OpenTextFile(Server.MapPath(page), _<BR> ForReading)<BR><BR>any help?<BR>

  2. #2
    Join Date
    Dec 1969

    Default It should have worked...

    Maybe you need to do:<BR><BR>&#060;%<BR>path = Request("path")<BR>fullPath = Server.MapPath(path)<BR>Response.Write "Trying to open file: " & fullPath & "&#060;P&#062;"<BR>set objTS = objFS.OpenTextFile(fullPath,ForReading)<BR>...<BR> %&#062;<BR><BR>DEBUG DEBUG DEBUG...always be 100% sure that you are *actually* doing what you *think* you are doing. And with ASP that almost always means lots of Response.Write calls!<BR><BR>

Posting Permissions

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