drruhc4944 2016-11-15 00:34
浏览 41
已采纳

照片报告PHP自动保存数据库

Good evening folks,

I have a mvc app where picture reports are created. So a user uploads pictures and then writes a description in a text box next to the picture. Sometimes these reports are very long and when there is an interrption (network signal lost, power cut, user hits back by mistake) the whole report is lost and the user has to start all over and its frustrating. So Id like to implement an auto save feature that also saves the picture information along with the descriptions so that the data is not lost is page if refreshed or power is cut... So would that be even possible with multiple pictures (about 40 per report)? Btw only image adresses are stored in the DB. And if its possible whats the best way, Ajax Auto Save?

  • 写回答

1条回答 默认 最新

  • douci6541 2016-11-15 00:40
    关注

    I'd recommend saving the report to the browser's local storage as it's typed.

    To clarify, I feel that this is more reliable than AJAX, as it doesn't require an internet connection or can't go wrong due to flaky internet.

    As an alternative you could use a cookie, which may work in older browsers and provides an avenue for you to delete it from the PHP side of things.

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

报告相同问题?

悬赏问题

  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)