Quantcast
Channel: Yii Framework Forum
Viewing all articles
Browse latest Browse all 18717

Xupload Path Image

$
0
0
hi friends
how to get image uploaded path in xupload etention ?

HomeController.php
class HomeController extends Controller
{
	

	
    public function actions()
    {
        return array(
            'upload'=>array(
                'class'=>'xupload.actions.XUploadAction',
                'path' =>Yii::app() -> getBasePath() . "/../uploads",
                'publicPath' => Yii::app() -> getBaseUrl() . "/uploads",
            ),
        );
    }

    function actionEditUser($id)
    {
	$model 	= User::fetchUserData($id);
	$upload = new XUploadForm;
        //.... any code
        $this->render('back/editUser',array('model'=>$model, 'perm'=>$permission, 'listAccess'=>$listAccess, 'upload' => $upload));

    }
}


views/home/editUser.php

<?php
$this->widget('xupload.XUpload', array(
	'url' => Yii::app()->createUrl("cpanel/home/upload", array("parent_id" => 1)),
	'model' => $upload,
	'attribute' => 'file',
	'multiple' => true,
));
?>


I then uploaded the photo URL into the text box !

Viewing all articles
Browse latest Browse all 18717

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>