?
Solved

FTP Date & Time a file was created

Posted on 2005-02-28
6
Medium Priority
?
359 Views
Last Modified: 2012-05-05
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
0
Comment
Question by:daveslater
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 11

Expert Comment

by:JohnModig
ID: 13419521
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 %>  
0
 
LVL 14

Author Comment

by:daveslater
ID: 13419666
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

0
 
LVL 11

Accepted Solution

by:
JohnModig earned 2000 total points
ID: 13419828
<%@LANGUAGE="VBSCRIPT"%>
<%
location = "c:\temp\myfile.zip"
set fso = createobject("scripting.filesystemobject")
set file_attrib = fso.getfile(location)
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>File info</title>
</head>
<body>
<b>File name</b>: <%= file_attrib.name %><br>
<br>
<b>Modified</b>: <%= file_attrib.datelastmodified %><br>
<b>Created</b>: <%= file_attrib.datecreated %><br>
<b>Size</b>: <%= file_attrib.size %> bytes<br>
<b>Type</b>: <%= file_attrib.type %><br>
</body>
</html>
0
Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

 
LVL 11

Expert Comment

by:JohnModig
ID: 13419869
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.
0
 
LVL 14

Author Comment

by:daveslater
ID: 13419971
Hi
cheers
Thanks for the quick responce.

dave
0
 
LVL 11

Expert Comment

by:JohnModig
ID: 13420593
No problem m8.
Glad I could help :)
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.
Suggested Courses

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question