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.

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

报告相同问题?

悬赏问题

  • ¥20 完全没有学习过GAN,看了CSDN的一篇文章,里面有代码但是完全不知道如何操作
  • ¥15 使用ue5插件narrative时如何切换关卡也保存叙事任务记录
  • ¥20 软件测试决策法疑问求解答
  • ¥15 win11 23H2删除推荐的项目,支持注册表等
  • ¥15 matlab 用yalmip搭建模型,cplex求解,线性化处理的方法
  • ¥15 qt6.6.3 基于百度云的语音识别 不会改
  • ¥15 关于#目标检测#的问题:大概就是类似后台自动检测某下架商品的库存,在他监测到该商品上架并且可以购买的瞬间点击立即购买下单
  • ¥15 神经网络怎么把隐含层变量融合到损失函数中?
  • ¥15 lingo18勾选global solver求解使用的算法
  • ¥15 全部备份安卓app数据包括密码,可以复制到另一手机上运行