you have that problem because you haven't passed $property_id
to your photo/upload
.
one way you could do this you can pass it via get variable. in your view:
$this->widget('bootstrap.widgets.TbFileUpload', array(
'url' => $this->createUrl("photo/upload", array( 'id='=> $model->id )),// I added to the uri
'model' => $model_photo,
'attribute' => 'picture',
'multiple' => true,
'options' => array(
'maxFileSize' => 2000000,
'acceptFileTypes' => 'js:/(\.|\/)(gif|jpe?g|png)$/i',
)));
then in your photo/controller
catch it:
$property_id = Yii::app()->request->getParam('id' , null); // or simply: $property_id = $_GET['id'];
then use it however you need.
cheers