Accessing Images In Protected Folder


I have a question regarding accessing images in the protected folder. I am creating a way for user to upload photos that I can’t have accessible from the browser directly (i.e.

So what I’ve done is created a folder called photos under my protected folder.

But when I try to access the images to display them in a form it does not seem to work correctly. This is what I’m doing:

<div class="table-cell-photo" id="picture">			

	<?php $dest = Yii::getPathOfAlias(''); ?>		

	<?php echo CHtml::image($dest.'/'.$model->photo,"Photo",array("width"=>200)); ?>

	<?php echo "<p><br>".CHtml::activeFileField($model, 'photo'); ?>  

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


I was reading somewhere about needing a proxy script to be able to do this? If you could give me any assistance I’d really appreciate it.


this link might help you

Yes! Thanks so much – exactly what I was looking for.

thak for yii framework