dongqia0240 2010-06-11 17:20
浏览 120
已采纳

如何找出文件下载次数?

I have an image that send to affiliate for advertising. so, how can I find it out from my server the number of times that image been downloaded? does server log keep track of image upload count?

---- Addition ---- Thanks for the reply.. few more questions

because I want to do ads rotation, and tracking IP address, etc. so, i think I should do it by making a dynamic page (php) and return the proper images, right?

In this case, is there anyway that I can send that information to Google Analytics from the server? I know I can do it in javascript. but now, since the PHP should just return the images file. so what I should do? :)

  • 写回答

5条回答 默认 最新

  • douluoyou9876 2010-06-19 06:47
    关注

    Well This can be done irrespective of your web Server or Language / Platform.

    Assuming the File is Physically stored in a Certain Directory. Write a program that somehow gets to know which file has to be downloaded. Through GET/POST parameters. There can be even more ways. then point that particullar file physically.

    fopen that file
      read through it byte by byte
      print them
    fclose
    store/increment/updatethe download counter in database/flatfile
    

    and in the database you may keep the record as md5checksum -> downloadCounter

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(4条)

报告相同问题?

悬赏问题

  • ¥15 在获取boss直聘的聊天的时候只能获取到前40条聊天数据
  • ¥20 关于URL获取的参数,无法执行二选一查询
  • ¥15 液位控制,当液位超过高限时常开触点59闭合,直到液位低于低限时,断开
  • ¥15 marlin编译错误,如何解决?
  • ¥15 有偿四位数,节约算法和扫描算法
  • ¥15 VUE项目怎么运行,系统打不开
  • ¥50 pointpillars等目标检测算法怎么融合注意力机制
  • ¥20 Vs code Mac系统 PHP Debug调试环境配置
  • ¥60 大一项目课,微信小程序
  • ¥15 求视频摘要youtube和ovp数据集