点击后的浏览按钮在plupload中不起作用?

时间:2014-10-27 10:45:13

标签: plupload

我使用plupload上传文件。它工作正常,但在plupload窗口,我可以按浏览按钮,只选择一次文件。如果我再次单击浏览按钮,它将无法正常工作。   我需要在点击上传按钮之前始终启用浏览按钮。

function FnToUploadDocs() {
    $("#uploaderContainer").html("<div id=\"pl_uploader\">In order to upload a file to the Document Manager, Microsoft Silverlight must be installed. <br/> Click on the following link to install   <u><a href='http://www.microsoft.com/getsilverlight/Get-Started/Install/Default.aspx' target='_blank'>Microsoft Silverlight</a></u> </div>");
    var uploader = $("#pl_uploader").pluploadQueue({
        // General settings
        runtimes: 'html5,silverlight,flash',
        url: '/../Upload/UploadDocs',
        max_file_size: '50mb',
        unique_names: true,
        flash_swf_url: '/Scripts/plupload/plupload.flash.swf',
        silverlight_xap_url: '/Scripts/plupload/plupload.silverlight.xap',
        filters: [{ title: "All Document Files", extensions: "doc,txt,docx,xls,xlsx,ppt,pptx,pdf,jpg,jpeg,png"}],
        multipart_params: {
            ObjectTypeId: $("#hdnDocObjectType").val(),
            ObjectId: $("#hdnDocObjectId").val()
        },
        init: {
            FileUploaded: function (up, file, info) {
                // Called when a file has finished uploading
                arrayserverData = info.response.split(',');
                uploadResponse = true;
                if (jQuery.inArray('Success', arrayserverData) == -1)
                    uploadResponse = false;
                if (up.total.uploaded == up.files.length) {
                    uploader.splice();
                    if (!uploadResponse) {
                       alert("Error in uploading");
                    }
                    else {
                         alert("Files added successfully");
                    }

                }
            }
        }
    });
     $('#pl_uploader > div.plupload').css('z-index', '99999');
     $("#dialog-upload").dialog(
            {
                resizable: false,
                closeOnEscape: false,
                position: [0, 0],
                modal: true,
                width: 500,
                height: 352,
                close: function (event, ui) {
                    //clear previous files and details
                    $(".filelog").html("");
                    if ($("#ifUploaded").val() == "true") {
                        $("#ifUploaded").val("false");
                    }
                    $("#uploaderContainer").html("");
                    $("#dialog-upload").dialog("destroy");
                    return;
                }
            });
$(".ui-dialog-titlebar-close").css("display", "none");
}

0 个答案:

没有答案