精细上传消息错误

时间:2015-02-23 15:35:17

标签: yii widget fine-uploader

我正在使用yii框架和精细上传器。当我在新服务器上移动项目时,我突然在控制台中收到此消息错误:

Error: element not found file
throw new Error('element not found ' + type);

这是我收到错误的代码。但我不明白这是做什么的(这是来自图书馆的精品上传者)

_find: function(parent, type){
        var element = qq(parent).getByClass(this._options.classes[type])[0];
        if (!element){
            throw new Error('element not found ' + type);
        }

        return element;
    },

这是php代码:

    <?php
    $this->widget('ext.fineuploader.EFineUploader', array(
        'id' => 'FineUploader',
        'config' => array(
            'autoUpload' => true,
            'text' => array(
                'uploadButton' => 'Adaugă CV'
            ),
            'request' => array(
                'endpoint' => $this->createUrl("/cariera/uploadTmpFile"),
                'params' => array('YII_CSRF_TOKEN' => Yii::app()->request->csrfToken),
            ),
            'retry' => array('enableAuto' => false, 'preventRetryResponseProperty' => true),
            'chunking' => array('enable' => true, 'partSize' => 100), //bytes
            'callbacks' => array(
                'onComplete' => "js:function(id, name, response){ "
                . "  if(response.success){"
                . "    $('#Candidate_cv_path_em_').hide();"
                . "    $('#Candidate_cv_path').val(response.folder+'/'+name);"
                . "    var width = $('.qq-upload-button > div').width();"
                . "    if($('.qq-upload-button > div.progressBar')){"
                . "          $('.qq-upload-button > div.progressBar').remove();"
                . "    }"
                . "    $('.qq-upload-button').prepend('<div class=\"progressBar\"></div>');"
                . "    $('.qq-upload-button > div.progressBar').animate({width: '150px'}, 1000, function(){ $('.qq-upload-button > div').html('CV atașat'); });"
                . "  }"
                . "}",
                'onError' => "js:function(id, name, errorReason){ $('#Candidate_cv_path_em_').html(errorReason).show();}",
            ),
            'validation' => array(
                'allowedExtensions' => array(),
                'sizeLimit' => 2 * 1024 * 1024, //maximum file size in bytes
                'minSizeLimit' => 1, // minimum file size in bytes
                'acceptFiles' => 'application/pdf, application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/msword'
            ),
        )
    ));
    echo "<span class='info_upload'>(.pdf, .doc, .docx)</span>";
//    echo $form->error($applicant, 'cv', array('class' => "errorMessage errorCv"));
//    echo $form->labelEx($applicant, 'cv', array('label' => '<span class="progressBar"></span>Upload CV', 'class' => 'uploadcv'));
//    echo $form->fileField($applicant, 'cv', array('size' => '1', 'class' => 'hiddenInputFile'));
    ?>

有人可以帮我这个吗?

更新: 我注意到它没有在新服务器上生成此html部分:

<ul class="qq-upload-list">
<li class=" qq-upload-success">
     <div style="display: none; width: 100%;" class="qq-progress-bar">
    </div>
     <span style="display: none;" class="qq-upload-spinner"></span>
     <span class="qq-upload-finished"></span>
     <span class="qq-upload-file">free_cv_sample_template.pdf</span>
     <span style="display: inline;" class="qq-upload-size">0.1MB</span>
     <a style="display: none;" class="qq-upload-cancel" href="#">Cancel</a>
     <a class="qq-upload-retry" href="#">Retry</a>
     <a class="qq-upload-delete" href="#">Delete</a>
     <span class="qq-upload-status-text"></span>
</li>
</ul>

为什么?

0 个答案:

没有答案