[Project_owners] Get timestamp of a remote file?

Pete Collins pete at mozdevgroup.com
Fri Jan 6 09:01:10 EST 2006



Dan Lee wrote:

> Does anyone know of a way to get the timestamp for a remote file?

If it's over http you can use jsLib RemoteFile library:

// -----------------------------------------------------
  jslib.init(this);
  include(jslib_remotefile);

  var url = "http://www.mozdev.org";
  var rf = new RemoteFile (url);

  var ts = rf.lastModified;

  jslibPrintMsg("lastModified", ts);

// -----------------------------------------------------


Docs:

  jslib:remotefile
  http://jslib.mozdev.org/libraries/network/remotefile.html

Note, LastModified is pulled from the http header and not all headers 
include it.

--pete

-- 
Pete Collins - Founder, Mozdev Group Inc.
www.mozdevgroup.com
Mozilla Software Development Solutions
tel: 1-719-302-5811
fax: 1-719-302-5813



More information about the Project_owners mailing list