yhl27ml@163.com 2011-09-05 10:28:03 3336次浏览 3条回复 0 0 0

swfupload extension 我按说明上的用法,我为什么不行? 会报js错啊,302, 错误2038 哪位用过的请指点下

  • 回复于 2011-09-05 10:31 举报

    要贴代码啊 你使用的地方 和错误截图

  • 回复于 2011-09-05 10:42 举报

    视图:

    <?php
    $this->widget('application.extensions.swfupload.CSwfUpload', array(
        'jsHandlerUrl'=>Yii::app()->baseUrl.'/js/swfupload/handlers.js', //Relative path
        'postParams'=>array(),
        'config'=>array('debug'=>true,
            'use_query_string'=>true,
            'upload_url'=>$this->createUrl('processpic'), //Use $this->createUrl method or define yourself
            'file_size_limit'=>'2 MB',
            'file_types'=>'*.jpg;*.png;*.gif',
            'file_types_description'=>'Image Files',
            'file_upload_limit'=>0,
            'file_queue_error_handler'=>'js:fileQueueError',
            'file_dialog_complete_handler'=>'js:fileDialogComplete',
            'upload_progress_handler'=>'js:uploadProgress',
            'upload_error_handler'=>'js:uploadError',
            'upload_success_handler'=>'js:uploadSuccess',
            'upload_complete_handler'=>'js:uploadComplete',
            'custom_settings'=>array('upload_target'=>'divFileProgressContainer'),
            'button_placeholder_id'=>'swfupload',
            'button_width'=>170,
            'button_height'=>20,
            'button_text'=>'<span class="button">'.Yii::t('messageFile', 'ButtonLabel').' (Max 2 MB)</span>',
            'button_text_style'=>'.button { font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif; font-size: 11pt; text-align: center; }',
            'button_text_top_padding'=>0,
            'button_text_left_padding'=>0,
            'button_window_mode'=>'js:SWFUpload.WINDOW_MODE.TRANSPARENT',
            'button_cursor'=>'js:SWFUpload.CURSOR.HAND',
            ),
        )
    );
    

    控制器:

    public function actionProcesspic() {
        $filedata=$_FILES['Filedata'];
        @move_uploaded_file($filedata['tmp_name'],'/var/www/'); // Not relative. Full path
    }
    ?>
    
    <?php echo CHtml::beginForm(); ?>
    <div class="form">
        <div class="row">
        <div id="divFileProgressContainer"></div>
        <div class="swfupload"><span id="swfupload"></span></div>
        </div>
    </div>
    <?php echo CHtml::endForm(); ?>
    
  • 回复于 2011-09-05 10:44 举报

    报错:[attach]343[/attach][attach]344[/attach]

您需要登录后才可以回复。登录 | 立即注册