关于:swfupload-强大而灵活的上传引擎的几个疑问 [ 新手入门 ]
本网站的讲解在这里:如何在 ActiveRecord 自动化记录时间戳 我是按照这个一步步做的,可是还是不成功,希望会做的大侠们指点迷津。很急很急啊,跪求了。 'upload_success_handler'=>'js:uploadSuccessListView' TO 'upload_success_handler'=>'js:uploadSuccess'.Requirements 文中说的上面的这个部分没找到; 下载了扩展到protected/extensions 了,可是没找到handler.js 文中的在控制器中的 $filedata=$_FILES['Filedata']; @move_uploaded_file($filedata['tmp_name'],'path/to/folder'); // Not relative. Full pathOn Views 应该是用来接收上传的文件值的吧,可是'path/to/folder'这个路径我也改了啊,怎么传不上去呢? 文中的:
<?
$this->widget('application.extensions.swfupload.CSwfUpload', array(
'jsHandlerUrl'=>'path/to/handler.js', //Relative path
'postParams'=>array(),
'config'=>array(
'use_query_string'=>true,
'upload_url'=>'/path/to/controller/action', //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',
),
)
);
?>
<?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(); ?>
我只改了'/path/to/controller/action',改为提交到哪个页面的地址,也就是controller下的一个action,对吧?其他的看不懂就没敢改 我测试了,显示文件名和上传成功了,如图:[attach]306[/attach] [attach]306[/attach]
我想知道哪个地方不对啊,怎么改啊,很急很急啊,跪求啊
共 0 条回复
没有找到数据。
wqq1207
注册时间:2011-05-04
最后登录:1970-01-01
在线时长:0小时0分
最后登录:1970-01-01
在线时长:0小时0分
- 粉丝0
- 金钱175
- 威望0
- 积分175