Monday, April 2, 2012

Re: picture virus problem!!!!!

thanks very much buddy............

On Mon, Apr 2, 2012 at 7:36 PM, Salines <nikola.paradzik@gmail.com> wrote:
Sorry, i send incomplete post.

--------------


To solve your problem, you must validate your uploads.

<?php
public $validate = array(
    'image' => array(
        'extension' => array(
        'rule'    => array('extension', array('gif', 'jpeg', 'png', 'jpg')),
        'message' => 'Please supply a valid image.'
    ),
    'mimetype' => array(
        'rule'    => 'mimetype',

        'message' => 'Please supply a valid image.'
    ),

    ),
 );

public function mimetype($check){
 
    // create your validation code using File::info or File::mime (cakephp 2.1)

}



Useful links.

http://book.cakephp.org/2.0/en/models/data-validation.html#adding-your-own-validation-methods
http://book.cakephp.org/2.0/en/core-utility-libraries/file-folder.html#file-api
http://api20.cakephp.org/view_source/file#l-299

look at 2.1  cakephp/lib/Cake/Utility/File.php  line 556




--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
 
 
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php



--
Litto Chacko
Axtec Softwares

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
 
 
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

No comments: