hi,
I was frustation using CUploadedFile so I decide to try external libary and I use from this site http://www.verot.net/php_class_upload_samples.htm,
but I get error when using this library.
here is my code:
if($_FILES['filename']){
if(move_uploaded_file($_FILES['filename']['tmp_name'], 'images/blue.png')){
require_once(Yii::app()->getExtensionPath() . DIRECTORY_SEPARATOR . 'upload/upload.php');
$handle = new Upload('images/blue.png');
$handle->image_resize = true;
$handle->image_ratio_y = true;
$handle->image_x = 400;
$handle->image_y = 400;
$handle->process('thumb');
}
}
the process above that I want is, after filename (image) is uploaded, it will be creating thumbnail too and will be stored in "images/thumb" directory.
the error when I test this code is:
PHP Error
Description
include(finfo.php) [<a href='function.include'>function.include</a>]: failed to open stream: No such file or directory
Source File
/mnt/win_d/www/myapp/framework/YiiBase.php(338)
00326: * @param string class name
00327: * @return boolean whether the class has been loaded successfully
00328: */
00329: public static function autoload($className)
00330: {
00331: // use include so that the error PHP file may appear
00332: if(isset(self::$_coreClasses[$className]))
00333: include(YII_PATH.self::$_coreClasses[$className]);
00334: else if(isset(self::$_classes[$className]))
00335: include(self::$_classes[$className]);
00336: else
00337: {
00338: include($className.'.php');
00339: return class_exists($className,false) || interface_exists($className,false);
00340: }
00341: return true;
00342: }
thanks for attention