$(\’#image\’).on(\’change\’, function () {
        var url = “”;
        var form = new FormData();
        form.append(“file”, this.files[0]);
        var settings = {
            “url”: url,
            “method”: “POST”,
            “timeout”: 0,
            “headers”: {
                deviceType:”5″,
                deviceId:md5(“navigator.userAgent”)
            },
            “processData”: false,
            “mimeType”: “multipart/form-data”,
            “contentType”: false,
            “data”: form
        };
        $.ajax(settings).done(function (response) {
            console.log(response);
        });
    })

  

版权声明:本文为jing428原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://www.cnblogs.com/jing428/p/10253500.html