grey5659
V2EX  ›  问与答

laravel 提交表单同时上传文件 ajax 错误

  •  
  •   grey5659 · Apr 9, 2018 · 2200 views
    This topic created in 3137 days ago, the information mentioned may be changed or developed.
    5 replies  •  2018-04-09 16:37:06 +08:00
    mchl
    mchl
    Apr 9, 2018
    1
    你这个不是 ajax 吧,前端怎么提交的?
    grey5659
    grey5659
    OP
    Apr 9, 2018
    2
    @mchl ajax 的代码没有截上来...图片和表单数据都上传成功但是返回的 json 数据直接被输出了,前端没有相应 json 的值弹出提示框
    b821025551b
    b821025551b
    Apr 9, 2018
    3
    错误信息说的很详细,store()前是 null,那就是$resuest->file('story')是 null,所已没有 key 值为‘ story ’的文件传上去;
    至于为什么会有图片传上去,建议仔细看看网络请求发了几次,或者服务端打 log ;
    描述了一大堆,关键的信息没给出多少。
    vex2
    vex2
    Apr 9, 2018
    4
    HTTP 基础了解一下。
    grey5659
    grey5659
    OP
    Apr 9, 2018
    5
    已经搞定了,谢谢各位..
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2360 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 04:53 · PVG 12:53 · LAX 20:53 · JFK 23:53
    ♥ Do have faith in what you're doing.