2

Fine Uploader 4.0 の新しい「カスタム ビルド」をダウンロードしました。私のページは、数週間前にインストールしてセットアップした 3.9 で正常に動作していました。

私のコード:

Click "Select Files" and pick the files you would like to upload.  Then click "Upload Now" to start the transfer.
<hr>
<div id="fineuploader-s3"></div>
<div id="triggerUpload" class="btn btn-primary" style="margin-top: 10px;">
    <i class="icon-upload icon-white"></i> Upload now
</div>

    <script src="http://code.jquery.com/jquery-latest.js"></script>
    <script src="http://xxxxxxx/fineuploader-4.0.3/custom.fineuploader-4.0.3.js"></script>
    <script>


      $(document).ready(function () {

          var manualuploader;

          function check_done() {
              if (allUploadsCompleted() === true) {
                  var successUrl = "http://xxxxxxxx/FineUploadComplete?ftpSessionId=xxxxxx";
                  $.get( successUrl );
                  alert('Your upload is complete.');
                  window.top.location = "xxxxxxxx";
              } 
           }

           function allUploadsCompleted() {
               // If and only if all of Fine Uploader's uploads are in a state of completion will this function fire the provided callback.
               var inProgress = manualuploader.fineUploader('getInProgress');
               if (inProgress === 0) {
                   var failedUploads = manualuploader.fineUploader('getUploads', { status: qq.status.UPLOAD_FAILED });
                   if (failedUploads.length === 0) {
                       return true;
                   }
                }        
                return false;
            }


            manualuploader = $('#fineuploader-s3').fineUploaderS3({
                debug: true,
            autoUpload: false,
                editFilename: {
                enabled: true
            },
            element: $('#fineuploader-s3')[0],
            text: {
                uploadButton: '<i class="icon-plus icon-white"></i> Select Files'
                },
                cors: {
                       expected: true,
                       sendCredentials: true
                },
                request: {
                    endpoint: "xxxxx",
                    accessKey: "xxxx"
                },
                signature: {
                    endpoint: "http://xxxxxx/S3UploadSig"
                },
        objectProperties: {
                key:  function (fileId) { return "xxxx" + '/' + $("#fineuploader-s3").fineUploader("getName",fileId); } 
            },
                retry: {
                        showButton: true
                },
                chunking: {
                        enabled: true
                },
                resume: {
                        enabled: true
                },
                deleteFile: {
                        enabled: false
                },
                callbacks: {
                    onStatusChange: function (id, oldStatus, newStatus) {
                        // This will check to see if a file that has been cancelled
                        // would equate to all uploads being 'completed'.
                        if (newStatus === qq.status.CANCELLED) {
                            check_done();
                        }     
                    },
                    onComplete: check_done
                },
                validation: {
            allowedExtensions: [xxxxxx]
                }
          });

    $('#triggerUpload').click(function() {
            manualuploader.fineUploader('uploadStoredFiles');
        });

      });
    </script>

Javaコンソールに次のエラーが表示されます...

不明なエラー: ID 'qq-template' でテンプレート スクリプトが見つかりません!

@ custom.fineuploader-4.0.3.js:4915

このエラーを回避するにはどうすればよいですか? また、4.0 で動作させるために他に必要な変更はありますか?

ありがとう、J

4

2 に答える 2