JS 上传文件之FormData 与Blob 对象

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>SA</title>
    <link rel="stylesheet" href="http://oscxc.oschina.io/open/open.css">
    <script src="http://oscxc.oschina.io/open/open.js"></script>
    <script>
        $.domLoad(function () {
            var formdata = new FormData();
            formdata.append("a","ffdfdf");
            formdata.append("file1",new Blob(["Hello World!"],{type:"text/plain"}));
            $.post("/home/SayHi",formdata,function (data) {
                console.log(data);
            });
        });
    </script>
</head>
<body>

</body>
</html>

已标记关键词 清除标记
相关推荐
©️2020 CSDN 皮肤主题: 技术工厂 设计师:CSDN官方博客 返回首页