For a local path:
<% path = "C:\inetpub\wwwroot\default.asp" parts = split(path,"\") response.write parts(ubound(parts)) %> |
For a URL, there is only one slight change:
<% path = "http://localhost/default.asp" parts = split(path,"/") response.write parts(ubound(parts)) %> |
Keep in mind that if the path or URL doesn't have a file attached to it, you will get incorrect results. However, if the path is ONLY a file name, it will work fine (in other words, your file name doesn't HAVE to be part of a path or URL).