• App单个图片上传接口


     @RequestMapping(value = "/uploadRecord", method = RequestMethod.POST)

        public String uploadTest(@RequestParam(value = "file",required = false) MultipartFile file, HttpServletRequest request) {

         //        String savePath = request.getServletContext().getRealPath("/recodFiles/") + file.getOriginalFilename();

            System.out.println(file.getOriginalFilename());

            return "";

    }

    Ajax提交文件

        var formData = new FormData();

           formData.append('file', $('#file')[0].files[0]);

           $.ajax({

               url: '${ctx}/datum/asDatum/savePhoto',

               type: 'POST',

               cache: false,

               data: formData,

               processData: false,

               contentType: false,

               success:function(result){

               }

           })

  • 相关阅读:
    oracle学习13
    oracle学习12
    oracle学习11
    oracle学习10
    CodeForces
    CodeForces
    UVA
    poj3320 Jessica's Reading Problem
    poj2456 Aggressive cows
    jQuery 鼠标滚轮插件 mousewheel
  • 原文地址:https://www.cnblogs.com/fg-fd/p/6903294.html
Copyright © 2020-2023  润新知