Uploader

文件上传
选择文件
文件名 大小

HTML代码

<div id="btn_uploader">选择文件</div>

Javascript代码



var uploader = $p.uploader("#btn_uploader", {
    //上传API地址
    server: '/src/plugins/uploader/0.1.5/fileupload.php'
});

//当文件上传成功时触发
uploader.on('uploadSuccess', function(file) {
    $("#table_files").append([
        "<tr>",
            "<td><a>" + file.name + "</a></td>",
            "<td>" + file.size + "</td>",
        "</tr>"
    ].join(""));
});