ASP ParentFolder() - File Object This the tutorial/example asp script how to Get file properties and parent folder.
ShotDev Focus:
- ASP & Get file properties and parent folder.
Example
asp_file_parentfolder.asp
<% Option Explicit %> <html> <head> <title>ShotDev.Com Tutorial</title> </head> <body> <% Dim objFSO, objFile Set objFSO = Server.CreateObject("Scripting.FileSystemObject") Set objFile = objFSO.GetFile(Server.MapPath("MyFiles/shotdev.txt")) Response.Write "Attributes : " & objFile.Attributes & "<br>" Response.Write "Name : " & objFile.Name & "<br>" Response.Write "Drive : " & objFile.Drive & "<br>" Response.Write "ShortName : " & objFile.ShortName & "<br>" Response.Write "Size : " & objFile.Size & " bytes <br>" Response.Write "Type : " & objFile.Type & "<br>" Response.Write "Path : " & objFile.Path & "<br>" Response.Write "ParentFolder : " & objFile.ParentFolder & "<br>" Response.Write "ShortPath : " & objFile.ShortPath & "<br>" Response.Write "DateCreated : " & objFile.DateCreated & "<br>" Response.Write "DateLastAccessed : " & objFile.DateLastAccessed & "<br>" Response.Write "DateLastModified : " & objFile.DateLastModified & "<br>" Set objFSO = Nothing Set objFile = Nothing %> </body> </html>
Create a asp file and save to path root-path/myasp/
Run
http://localhost/myasp/asp_file_parentfolder.asp
Screenshot