xhf1024
V2EX  ›  React

react+antd 实现上传图片怎么调用接口传图片

  •  
  •   xhf1024 · Nov 19, 2019 · 3888 views
    This topic created in 2399 days ago, the information mentioned may be changed or developed.

    老哥们,大神们,怎么使用 react+antd 实现图片上传,后台接口的参数是 @RequestParam(value = "file") MultipartFile file 接口地址是 XXX/xxx/uploadImage 我前端不知道如何传参

    2 replies    2020-04-14 00:24:18 +08:00
    xhf1024
        1
    xhf1024  
    OP
       Nov 19, 2019
    求救求救,头皮挠破
    vent123
        2
    vent123  
       Apr 14, 2020 via iPhone
    用 xmlhttprequest, post 调用后台接口,content-type 是 multipartfile,requestpayload 是{file: imagefile} 具体怎么做你搜一下吧
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5675 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 76ms · UTC 07:10 · PVG 15:10 · LAX 00:10 · JFK 03:10
    ♥ Do have faith in what you're doing.