dongshi9407 2019-02-06 18:20
浏览 44

如何读取服务器端文件并循环显示所有文件

Users will access a website and upload some files to server.

I would like to use a forloop to loop through all uploaded images and display them. I will update the imageList by timer ,for example ,update the image list every 2mins.

The question is ,how I can loop through images files from web sever?Should I do this on client side or server side?

Thanks!

  • 写回答

1条回答 默认 最新

  • donglin5770 2019-02-06 18:34
    关注

    how I can loop through images files from web server?

    Often, when you make an HTTP request to your server, your server will go get data from the database and return it as JSON to the client. This is how you access your data. In your example, you will likely be returning an array or a data object with an array of images in it.

    Should I do this on client side or server side?

    What you are essentially asking is whether to use my server and database just for data persistence or also to contain business logic as well. A simple Google Search of something along the lines of, "Business logic on client or server" will get you pointed in the right direction. You'll see there are many considerations to this, and often one way versus the other is developer preference.

    评论

报告相同问题?

悬赏问题

  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?