2012-05-17 1 views
2

removeOriginal MeioUpload에서 작업하지 마십시오!Cakephp MeioUpload removeOrginal

/model/post.php

public $actsAs = array(
      'MeioUpload.MeioUpload' => array(
       'avatar' =>array(
       'thumbnails' => true , 
       'thumbsizes' => array('small' => array('width'=>100, 'height'=>100)), 
       'thumbnailQuality' => 75, 
       'thumbnailDir' => 'thumb', 
       'removeOriginal' => true 

       ) 
      ) 
     ); 

난 단지, 내가 원본 사진을 필요로하지 않는 엄지 손가락을 업로드 할 :

은 내가 내 게시물 모델에서이 코드가 있습니다.

(의 CakePHP 2.1.2)

감사

답변

0
이 행동은 감가 상각

더 이상 지원 (https://github.com/jrbasso/MeioUpload)하지만이 같은 문제가 있었 아직 마이그레이션 할 필요가 없습니다. 다음과 같이

저와 같은 보트에있는 사람들을위한

, 당신은 그것을 해결할 수 :

  • 열기 모델/행동/MeioUploadBehavior.php 코드 블록에 대한
  • 봐 두번 나타나는 :

    // If the file is an image, try to make the thumbnails 
    if ((count($options['thumbsizes']) > 0) && count($options['allowedExt']) > 0 && in_array($data[$model->alias][$fieldName]['type'], $this->_imageTypes)) { 
        $this->_createThumbnails($model, $data, $fieldName, $saveAs, $ext, $options); 
    } 
    
  • 번째 발생 (선두로부터 하에서 이미 나타나지 않음) 다음 코드 삽입 후 :

    if ($options['removeOriginal']) { 
        $this->_removeOriginal($saveAs); 
    } 
    

나는 이것을 프로젝트에서 수행했으며 지금까지는 잘 작동하는 것처럼 보인다.