0

「uploadify」jquery プラグインでサーバーに既に追加されているファイルをユーザーが追加できないようにする必要があります。

既に追加されているファイルを表示するグリッドがあるので、グリッドからファイル名のコレクションを取得し、選択機能でチェックして、既にアップロードされたファイルを追加しないようにする予定です。

これを行うためのより良い方法または簡単な方法はありますか?

コードの完成にご協力ください。

上記のロジックは機能しますか?

var uploadQueue = new Array();
jQuery().ready(function ($) {
 debugger;
            $.ajax({
                 type: "POST",
                 async: false,
                  url: ROOT + "Documents/DocumentAJAXController",
                 data: { "ID": $('[id="ID"]').val() },
                 success: function (result) {
                  }
            });

 $("#SubmitButton1").hide();
    $("#fileuploader").fileUpload({
            'uploader':  "@Url.Content("~/Scripts/FileUpload/uploader.swf")",
            'cancelImg':  "@Url.Content("~/Content/Images/clearBtn.png")",
            'buttonText': 'Browse Files',
            //'buttonImg' : "@Url.Content("~/Content/Images/attachDoc.png")",
            'script': "@Url.Content("~/Documents/Upload/")",   
            'folder': "@Url.Content("~/Documents/")",
            //'fileDesc': 'Documents Files',
            'fileExt': '*.pdf;*.doc;*.ppt;*.xls',
            'multi': true,
            'auto': false, 
            onError: function (a, b, c, d) {
            },
            'onSelect': function (event, queueID, fileObj) {

               // uploadQueue.push(queueID);

            },                
            'onAllComplete': function(event,data){
            alert("Uploaded successfully");
            $('.popupClose').click();
            }            
        });
4

1 に答える 1

0

この機能は、uploadify の最新バージョンに組み込まれています。

Uploadify は、 uploadify に渡す設定でcheckScript ハンドラーを提供します。

これを適切なサーバー スクリプトで指定すると、既に存在するファイルは許可されません。

というサンプル スクリプトcheck-exists.phpが、uploadify zip で提供されています。

于 2013-04-18T15:43:49.910 に答える