Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Getting last modified date of an image file

tmottmot Member Posts: 2
[b][red]This message was edited by tmot at 2005-8-5 14:6:51[/red][/b][hr]
Hi,
How do I display the "last modified date" of an image included in my html-document?

I have included the image using a simple:

WebCam image

... so now I would like to know when the file was created.

Thanks in advance for any help!
/Mattias


Comments

  • NCS_OneNCS_One Member Posts: 170
    : [b][red]This message was edited by tmot at 2005-8-5 14:6:51[/red][/b][hr]
    : Hi,
    : How do I display the "last modified date" of an image included in my html-document?
    :
    : I have included the image using a simple:
    :
    : WebCam image
    :
    : ... so now I would like to know when the file was created.
    :
    : Thanks in advance for any help!
    : /Mattias
    :
    :
    :

    Hi

    Try this :
    [code]
    function ShowFileAccessInfo(PathOfTheFile)
    {
    var fso, f, s;
    fso = new ActiveXObject("Scripting.FileSystemObject");
    f = fso.GetFile(filespec);
    s = f.Path.toUpperCase() + "
    ";
    s += "Created: " + f.DateCreated + "
    ";
    s += "Last Accessed: " + f.DateLastAccessed + "
    ";
    s += "Last Modified: " + f.DateLastModified
    return(s);
    }
    [/code]
    Call this function with PathOfTheFile for ex : "C:\Test.jpg".

    Hope it helps.
  • tmottmot Member Posts: 2
    Thanks!

    It works great! My problem is that the file I would like to check the date for, is located at a webserver. How can I access it from there?

    say:

    http://hem.passagen.se/test/test.jpg

    Thanks for any help!
    /Mattias

    : : [b][red]This message was edited by tmot at 2005-8-5 14:6:51[/red][/b][hr]
    : : Hi,
    : : How do I display the "last modified date" of an image included in my html-document?
    : :
    : : I have included the image using a simple:
    : :
    : : WebCam image
    : :
    : : ... so now I would like to know when the file was created.
    : :
    : : Thanks in advance for any help!
    : : /Mattias
    : :
    : :
    : :
    :
    : Hi
    :
    : Try this :
    : [code]
    : function ShowFileAccessInfo(PathOfTheFile)
    : {
    : var fso, f, s;
    : fso = new ActiveXObject("Scripting.FileSystemObject");
    : f = fso.GetFile(filespec);
    : s = f.Path.toUpperCase() + "";
    : s += "Created: " + f.DateCreated + "";
    : s += "Last Accessed: " + f.DateLastAccessed + "";
    : s += "Last Modified: " + f.DateLastModified
    : return(s);
    : }
    : [/code]
    : Call this function with PathOfTheFile for ex : "C:\Test.jpg".
    :
    : Hope it helps.
    :

Sign In or Register to comment.