counter on files?

Discussion in 'Web Design & Coding' started by ludlo, Mar 28, 2004.

  1. ludlo

    ludlo OSNN Addict

    Messages:
    96
    hello

    im running sambar server on a computer at home, and i need to check how many times a file has been downloaded, or start checking that.

    how can i code this?

    thanks
     
  2. Zedric

    Zedric NTFS Guru Folding Team

    Messages:
    4,006
    Location:
    Sweden
    [Edit]Oh dear, i read Apache, not Samba. :D Well in Samba, I have nooo idea, not even sure it's possible. Especially since you don't really "download" through Samba.


    ** Old crap**

    You could du it by using a small tracker and link to that instead of the file.

    Like file.zip becomes dltracker.php?file=file.zip

    The dltracker.php just increments the counter (in a file or database or whatever, your choice) and redirects to file.zip. This would however not work with direct links.

    Another choice would be to parse through the Apache access logs to find the number of hits. This could get a bit messy though. ;)
     
  3. ludlo

    ludlo OSNN Addict

    Messages:
    96
    is apache availible for windows? im such a noob :)
     
  4. Zedric

    Zedric NTFS Guru Folding Team

    Messages:
    4,006
    Location:
    Sweden
    Yes, but Apache is a web server. Samba isn't.
     
  5. ludlo

    ludlo OSNN Addict

    Messages:
    96
    well, dont know what samba is but im using SAMBAR web server :) but apache seems better, will download it and learn it. is it difficult to use apache?
     
  6. Zedric

    Zedric NTFS Guru Folding Team

    Messages:
    4,006
    Location:
    Sweden
    Oooohhh sambaR, *doh*, my mistake. :D Never heard of it.

    Apache is definately good, it's the most widely used on the net (I think). It's not very hard to use, but I don't know how easy sambar is so. ;)


    Samba btw is software you can use to share files between a Linux computer and a Windows computer for instance.
     
  7. ludlo

    ludlo OSNN Addict

    Messages:
    96
    ahaa =) okej then i know what samba is :p

    in sambar, you put your html files under sabar/docs/ and the you start it. not too much of setting up :p