2018-11-17 01:08



I'm using a motion detect security camera, which will upload all its captured photos via FTP, to my hosting service. To view and manage the photos, I created a PHP file which will allow me to either display all the photos or delete them all. This is just being used to make sure my cats are OK when I'm traveling. So the PHP file will simply display each file name, timestamp, and the photo, with maximum screen width, since I'll be viewing on a little i-phone.

My question is, do i need to add code to limit the number of photos on the page it creates? Or can I depend on the browser to be smart enough to just load the part of the page its displaying, discarding what is not visible. I need to know this because if one of the cats decides to roll around the floor for an hour at a time, and I don't get to check if for a full day, it feasible I could have 500+ images.

I guess its not that big a deal to add a maximum image limit in my form that controls the PHP code, but if browsers can automatically handle ridiculous size pages, that's one less thing to deal with

EDIT: after some experimentation I was surprised to find that (a) all my PC based browsers (even a lowly I-8) and mobile devices (including my ancient I-phone-4) had little trouble displaying 1000 images, at about 1024 x 780. BUT... (b) browsing through them (especially on a mobile device) was ridiculously tedious, and had I not been on wiFI, I'd have paid for all that data download. So the bottom line non quantified answer to "how many" on modern devices seems to be "a lot more than you'd ever have time to view".

So in the end I added a bit more to my display form and code, so I could view a reasonable number of images at a time, choose how many photos per/page, sort (forward or reverse) by time stamp, and a few other niceties. Everyone's comments wewre indeed helpful

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答


  • dongyan1808 dongyan1808 3年前

    The browser will load everything that's present in the html. So, you will have to limit the number of images uploaded yourself, maybe add a filter so it uploads only one image every 5 minutes.

    点赞 评论 复制链接分享