Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display File Attributes

Status
Not open for further replies.
Mar 20, 2002
2
0
0
US
I want to link to an Excel file on the server and display the file attributes on the web page. eg Last Modified Date, Last Modified Time, Last Modified By, etc.

Does anyone know how to do this?
 
Use the Scripting.FileSystemObject:

<%

Set oFS = Server.CreateObject(&quot;Scripting.FileSystemObject&quot;)
Set oFile = oFS.GetFile(&quot;C:/MyFile.xls&quot;)

Response.Write oFile.DateLastModified & &quot;<BR>&quot;
Response.Write oFile.DateCreated & &quot;<BR>&quot;
Response.Write oFile.DateLastAccessed & &quot;<BR>&quot;

Set oFile = Nothing
Set oFS = Nothing

%>

See Microsoft for the object model:


 
I tried placing the code in the body of my page and nothing happened. (Not even any errors.) Is it possible that the scripting .dll that the command calls isn't installed? I don't have access to check this on our server.

Thanks so much for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top