How to measure image's traffic?

Discussion in 'C#' started by wacamoi, Jan 3, 2009.

  1. #1
    Assume I have a image .jpg file

    How do I know how many times this .jpg has been viewed day by day?


    Thanks
     
    wacamoi, Jan 3, 2009 IP
  2. calcalmx123

    calcalmx123 Well-Known Member

    Messages:
    1,498
    Likes Received:
    58
    Best Answers:
    0
    Trophy Points:
    195
    #2
    AW Stats in CPanel.
     
    calcalmx123, Jan 3, 2009 IP
  3. wacamoi

    wacamoi Peon

    Messages:
    810
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #3
    do someone know how to read image's referer ?

    asp script would be nice

    thanks,
     
    wacamoi, Jan 4, 2009 IP
  4. jhannell

    jhannell Member

    Messages:
    55
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #4
    you can use an asp script for that.
    www.youraddress.com/yourimage.asp

    when users load yourimage.asp, you "internally" read your image by using ADODB procedures and redirect the binary data to your users. i am posting a sample code in asp, i wish this helps.



    Dim Stream: Set Stream = CreateObject("ADODB.Stream")
    Stream.Type = 1 'Binary
    Stream.Open
    Stream.LoadFromFile "c:\folder\image.jpg" '''' <----------put the full absolute path of your image here
    GetFileImage = Stream.Read
    Stream.Close

    <<<PUT YOUR COUNTER PROCEDURES HERE>>>

    response.binarywrite(GetFileImage ) ''' <----- we read the image, now we redirect it to the user's browser.




    ***
    Another trick is that, you can investigate your IIS server logs (xxx.log) etc.
     
    jhannell, Jan 5, 2009 IP