Get File Path By File Name

Results 1 to 2 of 2

Thread: Get File Path By File Name

  1. #1
    Join Date
    Dec 1969

    Default Get File Path By File Name

    &nbsp;<BR>I tried to find absolute path of a file, but the only infomation was provided is the file name. <BR>I tried use "FileSystemObject", the code likes:<BR><BR>Set objFSO = Server.CreateObject("Scripting.FileSystemObject") <BR>Set objFile= objFSO.GetFile(filename)<BR><BR>It doesn&#039t work. <BR>what kind of problem it is?<BR>(I use ASP 2.0)Is It version problem?<BR>Any alternative approach?

  2. #2
    Join Date
    Dec 1969

    Default RE: Get File Path By File Name

    Hey Sue.<BR><BR>First of all, the version isn&#039t a problem. Just use Server.MapPath like this:<BR><BR>&#060;%<BR> Response.Write Server.MapPath("default.asp")<BR>%&#062;<BR><BR>Or whatever your file name is. That will output the physical path of the file.<BR><BR>Hope that helps you. If you have any other questions feel free to e-mail me.<BR><BR>Take care,<BR>Lasse.<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