Upload Image And Video & Create Thumbnail

[font="Comic Sans MS"]Hi, [/font]

I have tried this link to upload image and create thumbnail for the uploaded image.

I have uploaded the image, and stored it in the local system successfully, and i want to display the uploaded image in the view page(thumbnail) and when I’m clicking on the thumbnail image, have to display the original image form the local folder…

How to fetch and display the images in the index(_view) page from the folder… :(

Please help me…

My Controller :

	public function actionCreateNew()


		$model=new Image;





		    	foreach($filelist as $thefile) {





					$model->image = $fileName;


						// pass destination path without letters and image format











	public function createimage($width, $height, $destination, $thumb, $type) {

		$obj_imgl = new thumbnail_images;

		$obj_imgl->PathImgOld = $destination.".".$type;

		$obj_imgl->PathImgNew = $destination."$thumb.".$type;

		$obj_imgl->NewWidth = $width;


			$obj_imgl->NewHeight = $height;


		if (!$obj_imgl->create_thumbnail_images())

			echo "error";



	<?php $form=$this->beginWidget('CActiveForm', array(



		    'htmlOptions'=>array('enctype' => 'multipart/form-data'),



<?php echo $form->errorSummary($model); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<div class="row">

		<?php echo $form->hiddenField($model,'author_id',array('value'=>Yii::app()->user->id)); ?>


	<div class="row">

		<?php echo $form->labelEx($model,'content'); ?>

		<?php echo $form->textArea($model,'content',array('rows'=>1, 'cols'=>50)); ?>

		<?php echo $form->error($model,'content'); ?>


		<?php echo $form->labelEx($model,'image'); ?>





						'name' => 'image',



						'duplicate'=>'Duplicate file!',

						'denied' => 'Invalid file type',



			echo $form->error($model,'image');


	<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>

	<?php $this->endWidget(); ?>


I have already used this code to get the image from the folder in another view page…

	<div style="border: 1px solid #066A75; padding: 3px; width:  220px; height: 150px; " id="left">

				<?php echo CHtml::link(CHtml::image(Yii::app()->request->baseUrl.'/images/pic/'.$data->image,


								/*array('view', 'id'=>$data->id),*/

								array('width'=>220, 'height'=>150))); ?>


And one more question is, is it possible to store and fetch the video files as like image?? If its possible please give me demo or tutorials link please… . i have struggled with these issue for past two days. :(

Thanks in advance…

The thumbnail image will be stored in db or not…