doushi2047 2016-09-22 21:22
浏览 58
已采纳

获取没有JSON的图片网址

I want to build comic book reading website that it has thousands of images on the server. Each series has hundreds of chapters and each chapter has tens of images. So I want to display these images on my website. How can we do this with less effort?

I am using AngularJS for the frontend, and for the API its Slim Framework.

I read that storing the img paths on the database is better solution. So its good to query all the image paths to MYSQL? Like http://mywebsite.com/mangas/naruto/23/001.jpg. Or use some sort of regular expression. But every image has different extensions. Some of it .png, some of it.jpg and some of it 3 digits naming, some of it 2 digits naming.

-And what about when I upload a new chapter. Do I have to query all the images again?

-So is there a solution for me like this: I upload chapter wtih SFTP and then automatically my website updates itself and the chapter I uploaded appear on my website. Is somemthing like this achievable?

  • 写回答

1条回答 默认 最新

  • doushou7169 2016-09-23 01:15
    关注

    So many many ways to do this.

    How about putting all the images for one chapter, in a CSV file stored on your server; so, one file for each chapter... then, request a chapter.

    Slim gets the httpRequest and fires a quick php read of the file; put each line into an array, inside a for loop. Then, to make it easier on the client side, the array before Slim returns the data.

    Then on client, each element of the array will be the name of one of the images for the chapter the user is viewing/reading; feed the image names into your Angular...

    Just take a deep breath and build something, then figure out how to make it better.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 如何在炒股软件中,爬到我想看的日k线
  • ¥15 51单片机中C语言怎么做到下面类似的功能的函数(相关搜索:c语言)
  • ¥15 seatunnel 怎么配置Elasticsearch
  • ¥15 PSCAD安装问题 ERROR: Visual Studio 2013, 2015, 2017 or 2019 is not found in the system.
  • ¥15 (标签-MATLAB|关键词-多址)
  • ¥15 关于#MATLAB#的问题,如何解决?(相关搜索:信噪比,系统容量)
  • ¥500 52810做蓝牙接受端
  • ¥15 基于PLC的三轴机械手程序
  • ¥15 多址通信方式的抗噪声性能和系统容量对比
  • ¥15 winform的chart曲线生成时有凸起