The documentation in the yii site its about the installation and basic usage, the documentation your guys are asking for, its the jquery documentation.
The answers to all this questions are in the wiki, please take a look there.
Hi, anybody know how to implement multiple instances of the widget in a single page, I’ve created 2 juidialog and loaded a widget on each one from diferent views, but when a add I file to the second xupload widget it is queued to the first one, so how do I add files to each one separately, thank you
The jquery plugin has been updated to a new version, however the new documentation lacks many examples for common task, the old wiki has been restored and the examples are now back for the old version, please vote here to update or not the extension. take into account the lack of documentation for the new version.
Hi, I included this into a form I have but not sure how to incorporate basic functionality. I have been through all the docs and anything I could find on it. I just want to be able to upload files (and hopefully rename them) into a directory and store a path into my db. Is there some guidance somewhere on how to get me started with this?
Asgaroth, I appreciate the response. Yes I have been through those files, like I said anything I could find on the topic. I just need a booster to get running with it. Sorry should have included some of what I have done. Here is just where things stand now since I have tried a variety of things. I tried incorporating actionMultiple into my actionUpload in the controller but that didn’t work. Since I included your code into my form I assume they should be together?
//controller
public function actionUpload() {
$model = new Image;
if (isset($_POST['Image'])) {
$model->setAttributes($_POST['Image']);
if ($model->save()) {
if (Yii::app()->getRequest()->getIsAjaxRequest())
Yii::app()->end();
else
$this->redirect(array('view', 'id' => $model->ImageId));
}
}
$this->render('upload', array( 'model' => $model));
}
public function actions()
{
return array(
'upload'=>array(
'class'=>'ext.xupload.actions.XUploadAction',
'subfolderVar' => 'ImageId',
'path' => realpath(Yii::app()->getBasePath()."/../images/uploads"),
),
);
}
public function actionMultiple(){
$model = new XUploadForm;
$this->render('multiple', array(
'model' => $model,
));
}
The form appears and allows me to select files. When I click upload my form is submitted but files are not put into the called directory.
//view - within an existing form
<?php
$this->widget('ext.xupload.XUploadWidget', array(
'url' => Yii::app()->createUrl("image/upload", array("ImageId" => 1)),
'model' => $model,
'attribute' => 'file',
'multiple' => true,
));
?>
My only response to that is because I was trying to include this as part of another form. Taking your advice and trying to start from square one without introducing other attributes into the upload process. This is what I have now.
//controller
public function actions()
{
return array(
'upload'=>array(
'class'=>'ext.xupload.actions.XUploadAction',
'subfolderVar' => 'ImageId',
'path' => realpath(Yii::app()->getBasePath()."/../images/uploads"),
),
);
}
public function actionMultiple(){
$model = new ImageUpload;
$this->render('multiple', array(
'model' => $model,
));
}
public function actionError()
{
if($error=Yii::app()->errorHandler->error)
{
if(Yii::app()->request->isAjaxRequest)
echo $error['message'];
else
$this->render('error', $error);
}
}
Did you want to see the generated javascript? Sorry I am new to t/s json but thought firebug would show JSON responses as javascript objects in its own tab under NET. I see nothing there though. My source does have the generated js if that is what you are talking about.
not the generated javascript, but the server JSON response, you (probably) can see that in the console. it is not clear to me if you got the demos working? what you are trying to do should be no problem, is the same funcionality as that of the demo.
Yeah the JSON response isn’t showing up at all. This is the error I get, although it does exist.
<h1>CHttpException</h1>
<p> does not exists. (.../protected/extensions/xupload/actions/XUploadAction.php:98)</p><pre>#0 .../protected/extensions/xupload/actions/XUploadAction.php(117): XUploadAction->init()
I am almost using your code directly just a couple of renames to fit my app. I will load the demos directly without my app and see if it works there. If so it will give me the basis to move forward.