[Info] http image request

Discussion in 'Programming' started by shayol, Oct 1, 2011.

  1. #1
    Hello,

    I want to know it's possible to know if an image is requested. I mean for example now i click on www.site.com/image.png i want to know when the image is requested.

    So if an image is not requested for 1 month for example will be deleted. I have a site of images hosting, and this can be usefull to delete unused image.

    Thank you for help
     
    shayol, Oct 1, 2011 IP
  2. Vooler

    Vooler Well-Known Member

    Messages:
    1,146
    Likes Received:
    64
    Best Answers:
    4
    Trophy Points:
    150
    #2
    Actually it is very hard to dig into apache logs to find out what was accessed and when it was accessed. What most of developers do is override the url's using Mod_Rewrite by creating an .htaccess file, kind of part of active SEO. In such technique they first receive request in a script and then script is meant to decide either to process or deny request, or even in your case delete the image directly.

    And btw, you can get the file creation time to determine how old the file is using php function, filectime.
    I would suggest you do some research on simple url rewriting, so that you cna add an agent script between user request and actual image.

    regards
     
    Vooler, Oct 1, 2011 IP