?
Solved

FTP Date & Time a file was created

Posted on 2005-02-28
6
Medium Priority
?
360 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
  • 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
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

Custom Android App Development is the need of an hour for several businesses. If you go through the right firm for Android Application Development, it can make a huge difference to the ways in which customers interact with your business.
By following these Magento e-commerce development tips, you can increase your website's conversion and profitability. Read this post for more details.
The viewer will learn how to count occurrences of each item in an array.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses
Course of the Month7 days, 2 hours left to enroll

593 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