web 2.0

ASP Type() - File Object

ASP Type() - File Object This the tutorial/example asp script how to Get file properties and type.

ShotDev Focus:
- ASP & Get file properties and type.

Example

asp_file_type.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_type.asp

Screenshot

ASP & Get file properties and type.
.
.
.

Download this script.
Download

1 Star2 Stars3 Stars4 Stars5 Stars6 Stars7 Stars8 Stars9 Stars10 Stars (1 votes, average: 1.00 out of 10)
Loading ... Loading ...

Leave a Reply

You must be logged in to post a comment.