Results 1 to 3 of 3

Thread: Last Uploaded Pic in directory

  1. #1
    Join Date
    Mar 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Last Uploaded Pic in directory

    i am looking for a script that shows the latest pic uploaded in a certain directory...

    can any1 plz help me???

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Ok, consider the following:

    .......1. You cannot get directories with javascript(atleast coming from my knowledge, someone correct me if I'm wrong please).

    .......2. You could do this with PHP, but get the last modified picture, not last uploaded...
    Jeremy | jfein.net

  3. #3
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    As long as all of the images were uploaded to the server, wouldn't last modified be the same as last uploaded?

    Anyways, if you used a naming convention for the images that showed the date, javascript could do this. Like if the images were named:

    2009_03_04.jpg

    for March 4th 2009. Then you could use the javascript date object to get the date and work backward until you found an image that would load as an image object. Once that was found, it could be displayed. But if you have a server side language like PHP or asp available, that would probably be a better choice, as the images could be named whatever you like, and you wouldn't have to wait for the image to load to know that it was there, and it would work even if the user had javascript off or unavailable.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •