weixin_33711641 2014-02-07 09:51 采纳率: 0%
浏览 12

Ajax文件上传进度栏

I'm using the following code to upload file to server,

    function FileUpload(SomestringParameter) {
var files = $("#file1").get(0).files;
if (files.length > 0) {
    if (window.FormData !== undefined) {
        var data = new FormData();
        for (i = 0; i < files.length; i++) {
            data.append("file" + i, files[i]);
    }
    $.ajax({
        type: "POST",
        url: "http://localhost:50443/UploadFile/" + SomestringParameter,
        contentType: false,
        processData: false,
        data: data,
        success: function (results) {
            alert(results);
            for (i = 0; i < results.length; i++) {
                alert(results[i]);
            }
        }
    });

} 
else {
    alert("This browser doesn't support HTML5 multiple file uploads!");
}
}
}

I like to use this plugin, jquery mobile progress bar, https://github.com/tolis-e/jQuery-Mobile-Progress-Bar-with-Percentage

How can I show that progress bar based on percent of file uploaded on to the server?.

I'm using web api on the server side to deal with the file uploaded.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
    • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
    • ¥20 有关区间dp的问题求解
    • ¥15 多电路系统共用电源的串扰问题
    • ¥15 slam rangenet++配置
    • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
    • ¥15 ubuntu子系统密码忘记
    • ¥15 保护模式-系统加载-段寄存器
    • ¥15 电脑桌面设定一个区域禁止鼠标操作
    • ¥15 求NPF226060磁芯的详细资料