C# MVC Ajax上传多个图片,可预览,可重复上传等

//上传文件
    function UploadFile(el) {
        var dataValue = $(el).attr("data-id");
        var ele = dataValue.toLowerCase();
        var f = document.getElementById(‘uploadFile_‘+ele).files[0]
        var src = window.URL.createObjectURL(f);
        document.getElementById(‘uploadPreview_‘ + ele).src = src;
        top.$("#uploadPreview_" + ele).attr("src", src);
        $("#upload_msg_" + ele).text("上传中,请稍候...");
        //上传应用图标
        $.ajaxFileUpload({
            url: "../../Manage/Flow/UploadFile",
            secureuri: false,
            fileElementId: [‘uploadFile_‘ + ele],
            dataType: ‘json‘,
            success: function (data) {
                if ((data.message).indexOf(‘error‘) >= 0) {
                    $("#upload_msg_" + ele).text(data.message);
                    $("#upload_msg_" + ele).css("color", "red");
                } else {
                    $("#" + dataValue).val(data.message);
                    $("#upload_msg_" + ele).text("上传成功!");
                    $("#upload_msg_" + ele).css("color", "#0a9a2f");
                }
            }
        });
    }

C# MVC Ajax上传多个图片,可预览,可重复上传等

 

C# MVC Ajax上传多个图片,可预览,可重复上传等

上一篇:win10备份驱动


下一篇:C# HttpWebRequest传递参数多种方式混合使用