Bonjour,

en fait voilà ce que j'ai fait:

1- j'ai créé mon composant (app/controllers/components/swf_upload.php), 
en copiant collant bêtement le contenu proposé

2- j'ai créé ma table files (comme indiqué dans le tuto)

3- j'ai créé un model files (via la console) et mon contrôleur lié, mais 
en fait c'est la vue qui pose problème....

j'ai simplement créé une action index dans mon contrôleur, pour intégrer 
ceci:

<?php echo $javascript->codeBlock("
    var swfupload_url = '" . $html->url('/js/swfupload/SWFUpload.swf') . "';
    var upload_url = '" . $html->url('/files/upload') . "';
    var file_info_url = '" . $html->url('/files/info') . "';"); ?>
<?php echo $javascript->link('swfupload/swfupload'); ?>
<?php echo $javascript->link('swfupload/init'); ?>
<div id="wrapper">

    <div id="contentContainer">
        <div id="SWFUploadTarget">
            <form action="<?php echo $html->url('/files/upload') ?>" 
method="post" onsubmit="return false" enctype="multipart/form-data">
                <?php print $html->file("Filedata"); ?>
               
                <input type="submit" value="Upload" />
            </form>
        </div>
        <div id="SWFUploadFileListingFiles">
        </div>
    </div>
   


comme indiqué dans le tuto, mais voilà, j'obtiens ceci comme erreurs:

*Notice* (8) <javascript:void(0);>: Array to string conversion 
[*CORE\cake\libs\file.php*, line *90*]

Code <javascript:void(0);> | Context <javascript:void(0);>

$path   =       array(
        "id" => false,
        "table" => null,
        "ds" => null,
        "alias" => "File",
        "name" => "File"
)
$create =       false
$mode   =       493

dirname - [internal], line ??
File::__construct() - CORE\cake\libs\file.php, line 90
ClassRegistry::init() - CORE\cake\libs\class_registry.php, line 128
Controller::loadModel() - CORE\cake\libs\controller\controller.php, line 446
Controller::constructClasses() - CORE\cake\libs\controller\controller.php, line 
397
Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 215
require - APP\webroot\index.php, line 90
[main] - APP\index.php, line 25

*Notice* (8) <javascript:void(0);>: Array to string conversion 
[*CORE\cake\libs\file.php*, line *91*]

Code <javascript:void(0);> | Context <javascript:void(0);>

$path   =       array(
        "id" => false,
        "table" => null,
        "ds" => null,
        "alias" => "File",
        "name" => "File"
)
$create =       false
$mode   =       493

is_dir - [internal], line ??
File::__construct() - CORE\cake\libs\file.php, line 91
ClassRegistry::init() - CORE\cake\libs\class_registry.php, line 128
Controller::loadModel() - CORE\cake\libs\controller\controller.php, line 446
Controller::constructClasses() - CORE\cake\libs\controller\controller.php, line 
397
Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 215
require - APP\webroot\index.php, line 90
[main] - APP\index.php, line 25

*Warning* (2) <javascript:void(0);>: basename() expects parameter 1 to be 
string, array given [*CORE\cake\libs\file.php*, line *92*]

Code <javascript:void(0);> | Context <javascript:void(0);>

$path   =       array(
        "id" => false,
        "table" => null,
        "ds" => null,
        "alias" => "File",
        "name" => "File"
)
$create =       false
$mode   =       493

basename - [internal], line ??
File::__construct() - CORE\cake\libs\file.php, line 92
ClassRegistry::init() - CORE\cake\libs\class_registry.php, line 128
Controller::loadModel() - CORE\cake\libs\controller\controller.php, line 446
Controller::constructClasses() - CORE\cake\libs\controller\controller.php, line 
397
Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 215
require - APP\webroot\index.php, line 90
[main] - APP\index.php, line 25

*Notice* (8) <javascript:void(0);>: Undefined variable: javascript 
[*APP\views\files\index.ctp*, line *1*]

Code <javascript:void(0);> | Context <javascript:void(0);>

$___viewFn      =       "D:\xampp\htdocs\workspace\cake\views\files\index.ctp"
$___dataForView =       array()
$loadHelpers    =       true
$cached =       false
$loadedHelpers  =       array(
        "Html" => HtmlHelper
HtmlHelper::$tags = array
HtmlHelper::$base = "/workspace/cake/index.php"
HtmlHelper::$here = "/workspace/cake/index.php/files"
HtmlHelper::$params = array
HtmlHelper::$action = "index"
HtmlHelper::$data = NULL
HtmlHelper::$_crumbs = array
HtmlHelper::$__docTypes = array
HtmlHelper::$helpers = NULL
HtmlHelper::$webroot = "/workspace/cake/webroot/"
HtmlHelper::$themeWeb = NULL
HtmlHelper::$plugin = NULL
HtmlHelper::$namedArgs = NULL
HtmlHelper::$argSeparator = NULL
HtmlHelper::$validationErrors = NULL
HtmlHelper::$__tainted = NULL
HtmlHelper::$__cleaned = NULL
HtmlHelper::$_log = NULL,
        "Form" => FormHelper
FormHelper::$helpers = array
FormHelper::$fieldset = array
FormHelper::$__options = array
FormHelper::$fields = array
FormHelper::$requestType = NULL
FormHelper::$base = "/workspace/cake/index.php"
FormHelper::$webroot = "/workspace/cake/webroot/"
FormHelper::$themeWeb = NULL
FormHelper::$here = "/workspace/cake/index.php/files"
FormHelper::$params = array
FormHelper::$action = "index"
FormHelper::$plugin = NULL
FormHelper::$data = NULL
FormHelper::$namedArgs = NULL
FormHelper::$argSeparator = NULL
FormHelper::$validationErrors = NULL
FormHelper::$tags = array
FormHelper::$__tainted = NULL
FormHelper::$__cleaned = NULL
FormHelper::$_log = NULL
FormHelper::$Html = HtmlHelper object,
        "Session" => SessionHelper
SessionHelper::$helpers = NULL
SessionHelper::$__active = true
SessionHelper::$valid = false
SessionHelper::$error = false
SessionHelper::$_userAgent = "9245d6edce8f905fffa3d41f37b8d3b3"
SessionHelper::$path = "/"
SessionHelper::$lastError = NULL
SessionHelper::$security = NULL
SessionHelper::$time = 1216453490
SessionHelper::$sessionTime = false
SessionHelper::$watchKeys = array
SessionHelper::$id = NULL
SessionHelper::$_log = NULL
SessionHelper::$base = "/workspace/cake/index.php"
SessionHelper::$webroot = "/workspace/cake/webroot/"
SessionHelper::$here = "/workspace/cake/index.php/files"
SessionHelper::$params = array
SessionHelper::$action = "index"
SessionHelper::$data = NULL
SessionHelper::$themeWeb = NULL
SessionHelper::$plugin = NULL
)
$helper =       SessionHelper
SessionHelper::$helpers = NULL
SessionHelper::$__active = true
SessionHelper::$valid = false
SessionHelper::$error = false
SessionHelper::$_userAgent = "9245d6edce8f905fffa3d41f37b8d3b3"
SessionHelper::$path = "/"
SessionHelper::$lastError = NULL
SessionHelper::$security = NULL
SessionHelper::$time = 1216453490
SessionHelper::$sessionTime = false
SessionHelper::$watchKeys = array
SessionHelper::$id = NULL
SessionHelper::$_log = NULL
SessionHelper::$base = "/workspace/cake/index.php"
SessionHelper::$webroot = "/workspace/cake/webroot/"
SessionHelper::$here = "/workspace/cake/index.php/files"
SessionHelper::$params = array
SessionHelper::$action = "index"
SessionHelper::$data = NULL
SessionHelper::$themeWeb = NULL
SessionHelper::$plugin = NULL
$camelBackedHelper      =       "session"
$html   =       HtmlHelper
HtmlHelper::$tags = array
HtmlHelper::$base = "/workspace/cake/index.php"
HtmlHelper::$here = "/workspace/cake/index.php/files"
HtmlHelper::$params = array
HtmlHelper::$action = "index"
HtmlHelper::$data = NULL
HtmlHelper::$_crumbs = array
HtmlHelper::$__docTypes = array
HtmlHelper::$helpers = NULL
HtmlHelper::$webroot = "/workspace/cake/webroot/"
HtmlHelper::$themeWeb = NULL
HtmlHelper::$plugin = NULL
HtmlHelper::$namedArgs = NULL
HtmlHelper::$argSeparator = NULL
HtmlHelper::$validationErrors = NULL
HtmlHelper::$__tainted = NULL
HtmlHelper::$__cleaned = NULL
HtmlHelper::$_log = NULL
$form   =       FormHelper
FormHelper::$helpers = array
FormHelper::$fieldset = array
FormHelper::$__options = array
FormHelper::$fields = array
FormHelper::$requestType = NULL
FormHelper::$base = "/workspace/cake/index.php"
FormHelper::$webroot = "/workspace/cake/webroot/"
FormHelper::$themeWeb = NULL
FormHelper::$here = "/workspace/cake/index.php/files"
FormHelper::$params = array
FormHelper::$action = "index"
FormHelper::$plugin = NULL
FormHelper::$data = NULL
FormHelper::$namedArgs = NULL
FormHelper::$argSeparator = NULL
FormHelper::$validationErrors = NULL
FormHelper::$tags = array
FormHelper::$__tainted = NULL
FormHelper::$__cleaned = NULL
FormHelper::$_log = NULL
FormHelper::$Html = HtmlHelper object
$session        =       SessionHelper
SessionHelper::$helpers = NULL
SessionHelper::$__active = true
SessionHelper::$valid = false
SessionHelper::$error = false
SessionHelper::$_userAgent = "9245d6edce8f905fffa3d41f37b8d3b3"
SessionHelper::$path = "/"
SessionHelper::$lastError = NULL
SessionHelper::$security = NULL
SessionHelper::$time = 1216453490
SessionHelper::$sessionTime = false
SessionHelper::$watchKeys = array
SessionHelper::$id = NULL
SessionHelper::$_log = NULL
SessionHelper::$base = "/workspace/cake/index.php"
SessionHelper::$webroot = "/workspace/cake/webroot/"
SessionHelper::$here = "/workspace/cake/index.php/files"
SessionHelper::$params = array
SessionHelper::$action = "index"
SessionHelper::$data = NULL
SessionHelper::$themeWeb = NULL
SessionHelper::$plugin = NULL

|<?php echo $javascript->codeBlock("
|

include - APP\views\files\index.ctp, line 1
View::_render() - CORE\cake\libs\view\view.php, line 646
View::render() - CORE\cake\libs\view\view.php, line 368
Controller::render() - CORE\cake\libs\controller\controller.php, line 733
Dispatcher::_invoke() - CORE\cake\dispatcher.php, line 260
Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 230
require - APP\webroot\index.php, line 90
[main] - APP\index.php, line 25


*Fatal error*: Call to a member function codeBlock() on a non-object in 
*D:\xampp\htdocs\workspace\cake\views\files\index.ctp* on line *1





*en fait le truc est que je ne comprends pas trop comme tout ceci 
s'articule. En fait j'ai l'impression qu'il y a un conflit de nom avec 
une librairie de cake,

*CORE\cake\libs\file.php*




voilà, c la galère;-)





Pierre MARTIN a écrit :
> Bonjour,
>
> Le view template mentionné dans le tutorial est juste un exemple d'un
> formulaire d'upload afin de voir la tête que cela doit avoir ("The
> following example gives you an idea of how to set up the view file").
> Tu peux donc copier ca dans ta vue en l'adaptant.
>
> Ensuite, je ne vois pas quoi détailler de spécial, essaie de suivre le
> tutorial pas à pas, et si tu as un problème de compréhension, dis-nous
> à quel endroit. Une fois cela fini, tu pourras regarder ce qu'il faut
> adapter pour Cake 1.2, mais à priori je ne vois pas grand chose à part
> peut-être un exit() à un endroit ... et rajouter l'i18n pour le texte,
> rien de primordial quoi.
>
> Bon courage, et surtout prends-ton temps pour faire les étapes une par
> une.
> Pierre
>
> On 18 juil, 18:36, bertrand kempf <[EMAIL PROTECTED]> wrote:
>   
>> en fait je suis parti de cela
>> :http://bakery.cakephp.org/articles/view/swfupload-and-multipurpose-up...
>>
>> mais bon, déjà je ne vois pas de quels templates il parle (model et
>> controller, pas de soucis), donc une petite aide me serait bien utile...;-)
>>
>> merci d'avance
>>
>> francky06l a écrit :
>>
>>     
>>> Cela ne doit pas etre trop difficile a porter.. Je crois me souvenir
>>> que Ad7Six avait quelque chose sur son blog a propos d'upload..
>>> http://www.ad7six.com/
>>>       
>>> On Jul 18, 6:30 pm, bertrand kempf <[EMAIL PROTECTED]> wrote:
>>>       
>>>> Bonjour,
>>>>         
>>>> j'ai bien trouvé un tuto pour cake 1.1.x au sujet de swfUpload... mais
>>>> en existe-t-il un pour cake 1.2?
>>>>         
>>>> merci d'avance
>>>>         
> >
>
>   


--~--~---------~--~----~------------~-------~--~----~

Groupe "Cakephp-fr".
Adresse : [email protected]
Pour résilier  : [EMAIL PROTECTED]
Pour les options : http://groups.google.com/group/cakephp-fr?hl=fr
-~----------~----~----~----~------~----~------~--~---

Répondre à