como voce chama o component no controller, tente verificar nomenclaturas.
Upper, lower.
Em 12/02/08, rodrigo aramburu <[EMAIL PROTECTED]> escreveu:
>
> Olá pessoal,
>
> Estou com um problema estranho. Estava desenvolvendo um pequeno
> gerenciador de conteúdo em um servidor linux, ai tive que mudar para uma
> windows(wamp) e começou a dar um problema, eu estava utilizando um component
> upload.php que estava funcionando bem no linux mas no windows ele esta
> dando um echo no component antes do html da pagina e mostrando a seguinte
> mensagem de erro:
>
> Missing Component Class
>
> *Error: * Component class *UploadComponent* in *ProdutosController* was
> not found.
>
> *Error: * Create the class *UploadComponent* in file:
> app\controllers\components\upload.php
>
> <?php
> class UploadComponent extends Object {
>
>
> }
> ?>
>
> *Notice: * If you want to customize this error message, create
> app\views\errors\missing_component_class.ctp
>
>
>
> arquivo upload.php
>
>
> <?
> class UploadComponent extends Object{
> var $controller = true;
> var $path = "";
> var $maxSize;
> var $allowedExtensions = array("jpg", "jpeg", "gif","png");
>
> function startup(&$controller){
> $this->path = APP.WEBROOT_DIR.DS;
> $this->maxSize = 2*1024*1024; // 2MB
> }
>
> function setPath($p){
> if ($p!=NULL){
> $this->path = $this->path.$p;
> $this->path = eregi_replace("/", DS, $this->path);
> $this->path = eregi_replace("\\\\", DS, $this->path);
> return true;
> }
> }
>
>
>
> function setMaxFileSize($size){
> $this->maxSize = $size;
> }
>
>
>
> function addAllowedExt($ext){
> if (is_array($ext)){
> $this->allowedExtensions =
> array_merge($this->allowedExtensions, $ext);
>
> }else{
> array_push($this->allowedExtensions, $ext);
> }
> }
>
>
> function getExt($file){
> $p = explode(".", $file);
> return $p[count($p)-1];
> }
>
>
> function copyUploadedFile($source, $destination){
> $pass = false;
> if (is_uploaded_file($_FILES[$source]["tmp_name"])){
> if ($_FILES[$source]["size"] < $this->maxSize){
> if (count($this->allowedExtensions)==0){
> // dont make validation
> $pass = true;
> }else{
> // make validation
> $pass = false;
>
> foreach($this->allowedExtensions as $ext){
>
> if
> (eregi(".*".$ext."$",$_FILES[$source]["name"])){
> $pass = true;
> }
> }
> }
> }
> if ($pass){
> // make upload
> $tmp = move_uploaded_file($_FILES[$source]["tmp_name"],
> $this->path.$destination);
> }else{
> // dont make the upload
> }
> }
> }
>
>
> }
> ?>
>
>
>
>
> alguem já passou por isso?
>
>
>
>
>
> --
> Atenciosamente,
> Rodrigo Pletsch Aramburu
> MSN:[EMAIL PROTECTED]
> >
>
--~--~---------~--~----~------------~-------~--~----~
Você recebeu esta mensagem porque está inscrito no Grupo "Cake PHP Português"
em Grupos do Google.
Para postar neste grupo, envie um e-mail para [email protected]
Para cancelar a sua inscrição neste grupo, envie um e-mail para [EMAIL
PROTECTED]
Para ver mais opções, visite este grupo em
http://groups.google.com/group/cake-php-pt?hl=pt-BR
-~----------~----~----~----~------~----~------~--~---