Link to home
Start Free TrialLog in
Avatar of daveslater
daveslaterFlag for United States of America

asked on

FTP Date & Time a file was created

Hi Experts
We have a web site that downloads a file using FTP.
This file is updates on an Adcock basis.
Is there any way that webpage can pick up the date & time the file was created?
What I don not want to do is manually enterer the details each time the download is updated.

Regards

Dave
Avatar of JohnModig
JohnModig

You could easily build a webpage that displays the info you need using asp.
Just about any attribute that is available by right mouse clicking on an item and displaying properties on a PC are available through the methods listed below:

<%
location = request.servervariables("appl_physical_path") + "\asp\file_spec.asp"
set fso = createobject("scripting.filesystemobject")
set file_attrib = fso.getfile(location)
%>

<b>Modified</b>
<br>
&lt;%= file_attrib.datelastmodified %&gt;
<%= file_attrib.datelastmodified %>
<br>
&lt;%= datevalue(file_attrib.datelastmodified) %&gt;
<%=datevalue(file_attrib.datelastmodified) %>
<br>
<b>Created</b>
<br>
&lt;%= file_attrib.datecreated %&gt;
<%= file_attrib.datecreated %>
<br>
&lt;%= datevalue(file_attrib.datecreated) %&gt;
<%=datevalue(file_attrib.datecreated) %>
<br>
<b>Size</b>
<br>
&lt;%= file_attrib.size %&gt;
<%= file_attrib.size %> bytes
<br>
&lt;%= file_attrib.size/1024 %&gt;
<%= file_attrib.size/1024 %> kb
<br>
<b>Type</b>
<br>
&lt;%= file_attrib.type %&gt;
<%= file_attrib.type %>
<br>
<b>Name</b>
<br>
&lt;%= file_attrib.name %&gt;
<%= file_attrib.name %>  
Avatar of daveslater

ASKER

Hi I am not that familiar with ASP or web pages
Can you please supply a bit of code that I can put into IE that will show the date & time of a file created as “c:\temp\myfile.zip”
I know it is a bit cheeky but I do not have a clue where to start or how to evoke that ASP code :0

Dave

ASKER CERTIFIED SOLUTION
Avatar of JohnModig
JohnModig

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Copy the code above into notepad and save as "fileinfo.asp" or some other name.
Then put the asp file on the webserver and type in the adress.
Hi
cheers
Thanks for the quick responce.

dave
No problem m8.
Glad I could help :)