使用swfupload上传出404错误 [ 新手入门 ]
Yii的扩展swfupload 每次上传文件时返回404错误,请问这是什么原因?
共 6 条回复
-
请问哪一个地方是配路径的啊?
<?php $this->widget('application.extensions.swfupload.CSwfUpload', array( 'jsHandlerUrl'=>'\Yii\path\to\handler.js', //Relative path 'postParams'=>array(), 'config'=>array( 'use_query_string'=>true, 'upload_url'=>Yii::app()->createUrl('upload'), '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', ), ) ); ?> <?php echo CHtml::beginForm(); ?> <div class="form"> <div class="row"> <div id="divFileProgressContainer"></div> <div class="swfupload"><span id="swfupload">abc</span></div> </div> </div> <?php echo CHtml::endForm(); ?>
是否这行有问题,
'upload_url'=>Yii::app()->createUrl('upload')
, 不是太明白这是用于做什么,是用于确定下载到服务器上的路径吗?
onunix china
注册时间:2012-03-19
最后登录:1970-01-01
在线时长:0小时0分
最后登录:1970-01-01
在线时长:0小时0分
- 粉丝2
- 金钱1145
- 威望0
- 积分1145