参考网址:https://blog.csdn.net/qq_41802303/article/details/80066160

 

==============================

我自己的代码:(用vue开发的,用的elementui)

 //文件上传
      upLoadFile(params) {
        console.log("文件上传的参数",params);
        var file = params.file;
        var that = this;
        const form = new FormData();
        // 文件对象
        form.append("file", file);
        $.ajax({
          url:"xxxxxx",
          type:"post",
          data:form,
          processData: false,
          contentType: false,
          success:function(res){
            console.log(res);
          }
        });
      },

 

相关文章:

  • 2022-01-06
  • 2022-02-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-06-26
  • 2021-11-15
相关资源
相似解决方案