落叶
[attach]247[/attach]这个西班牙人写的版本有点问题,我把修改过的版本发一下,主要是viewr的代码里的不一样,cotroller里的代码还是一样的,还有就是完善了那个功能。
view里的代码<?php //'use_query_string'=>true, // Creating the URL that will handle our uploads // check the parameter at the end // $uurl = $this->createUrl('picture/upload',array('yourvarname'=>$yourvar)); $uurl = $this->createUrl('site/upload'); // here is our widget! $this->widget('CSwfUpload', array( // here you include the post params you want the // upload function to handle when a file is submitted // 'postParams'=>array('yourvarname'=>$yourvar), 'config'=>array( 'use_query_string'=>false, //Use $this->createUrl method or define yourself 'upload_url'=> CHtml::normalizeUrl($uurl), // This is a workaround to avoid certain // issues (check SWFUpload Forums) 'file_size_limit'=>'2 gb', // Allowed file types 'file_types'=>'*.jpg;*.png;*.gif', // File types description (mine spanish) 'file_types_description'=>'Imagenes', // unlimited number of files 'file_upload_limit'=>0, // refer to handlers.js from here below 'file_queued_handler'=>'js:fileQueued', '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', // what is our upload target layer? 'custom_settings'=>array( 'upload_target'=>'divFileProgressContainer', 'cancelButtonId'=>"btnCancel", 'progressTarget'=>"fsUploadProgress",), // where are we going to place the button? 'button_placeholder_id'=>'swfupload', 'button_width'=>230, 'button_height'=>20, 'button_text'=>'<span class="button">Selecciona las Imagenes (2 MB Max)</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', ), ) ); ?> <div id="main-content"> <h2>Cargador de Imágenes</h2> <p>Haz click en el siguiente boton para cargar las imágenes de la Propiedad. El cargador de Imágenes las cargará y redimensionará automáticamente. </p> <form> <div class="form"> <div class="row"> <div id="fsUploadProgress"> <span class="legend">上传队列</span> </div> <div class="swfupload" style="display: inline; border: solid 1px #7FAAFF; background-color: #C5D9FF; padding: 2px;"> <span id="swfupload"></span> </div> <div id="divFileProgressContainer" style="height: 75px;"></div> <div id="thumbnails"></div> </div> </div> <input class="btn_startupload" type="button" onclick="swfu.startUpload();" value="开始上传"> </form> </div>
上传中文件名的文件时会出现乱码 并且找不到文件
我个人感觉没什么区别
看错了 原来这个可以直接引用 的
走过路过不容错过。。
- 落叶 回复了话题 yii的一些小的技巧
很好很强大
- 落叶 回复了话题 关于加载layout的问题
按zend的框架里来说这种写法是正确的 但在YII里你这种写法有点问题
- 落叶 回复了话题 如何验证过滤关键字?
不错 收藏了