无法处理fineUploader插件中提供的功能,

时间:2016-11-20 13:25:58

标签: fine-uploader

3以下功能不起作用

  • / *的GetFile(ID); =>这是第二个* /

  • / * getEndpoint(id); =>这是第三个* /

  • / * uploadStoredFiles(); =>这是第一个* / 那么代码是什么呢?

     <script>
                    var uploader = new qq.FineUploader({
                    debug: true,
                    element: document.getElementById('fine-uploader'),
                    request: {
                     endpoint: "endpoint.php"
                    },
                chunking: {
                enabled: true,
               concurrent: {
               enabled: true
                 },
    success: {
     endpoint: "endpoint.php?done"
        }
         },
    deleteFile: {
        enabled: true,
        endpoint: "endpoint.php"
        },
    
         retry: {
        enableAuto: true,
        showButton: true
        },
    
        autoUpload:false,
    

    uploadStoredFiles(); / * =&gt;这是第一个* /

                                                    callbacks: {
                                                     onError: function(id, name, errorReason, xhrOrXdr) {
                                                    alert(qq.format("Error on file number {} - {}.  Reason: {}", id, name, errorReason));
                                                },
                                                onComplete:function(id,name,responseJSON,xhr){ 
                                                    alert(getFile(id)); /* => here's the second */
                                                    alert(getEndpoint(id)); /* => here's the third */
         }
    
                                            },
    
                                            </script>
    

1 个答案:

答案 0 :(得分:0)

在调用方法方面,精细上传器并没有什么特别之处。与任何对象一样,您必须在实际对象上调用特定于对象的方法。方法不会神奇地添加到全局范围。

在回调处理程序之外,您必须在上传程序的实例上调用这些方法。在您的情况下(因为您已将构造的实例分配给名为uploader的变量):uploader.uploadStoredFiles()

在回调处理程序(例如onComplete)内,您可以调用this上的方法,例如:this.getFile(id)