Hello:
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. mysite.com/images).
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('application.photos'); ?>
<?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'); ?>
</div>
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.
Thanks!