[Extension] Xupload
#141
Posted 23 June 2012 - 06:03 AM
#142
Posted 23 June 2012 - 01:29 PM
ronyaja, on 23 June 2012 - 06:03 AM, said:
What is it you don't understand?, what have you tried, just saying "is not working" doesn't help me help you.
- Extension: XUpload - jQuery File Upload Extension
- Extension: PhpQuickProfiler - A Web Log Router that will help you profile your application
- Extension: XDateView - A Date grouped Grid View
- Extension: Foundation - An easy to use, powerful, and flexible framework for building prototypes and production code on any kind of device.
- Wiki: How to generate Yii like Documentation
- Wiki: How to re enable logging during unit testing
#143
Posted 23 June 2012 - 03:19 PM
ronyaja, on 23 June 2012 - 06:03 AM, said:
Questions are not like wine - they don't improve by age.
"Doesn't work" doesn't work.
#144
Posted 11 July 2012 - 05:58 AM
how can i change maxNumberofFiles after initialization?
Let's say i have a checkbox that's allowing a visitor to upload more than one files if clicked.
So i might want to bing a behaviour to that checkbox that changes maxNumberofFiles to 1 or 7.
is this possible?
thanks,
alp
#145
Posted 11 July 2012 - 09:26 AM
ungaro, on 11 July 2012 - 05:58 AM, said:
how can i change maxNumberofFiles after initialization?
Let's say i have a checkbox that's allowing a visitor to upload more than one files if clicked.
So i might want to bing a behaviour to that checkbox that changes maxNumberofFiles to 1 or 7.
is this possible?
thanks,
alp
Please check the widget options, the option you need its.
maxNumberOfFiles This option limits the number of files that are allowed to be uploaded using this widget. By default, unlimited file uploads are allowed. Type: number Example: 10
- Extension: XUpload - jQuery File Upload Extension
- Extension: PhpQuickProfiler - A Web Log Router that will help you profile your application
- Extension: XDateView - A Date grouped Grid View
- Extension: Foundation - An easy to use, powerful, and flexible framework for building prototypes and production code on any kind of device.
- Wiki: How to generate Yii like Documentation
- Wiki: How to re enable logging during unit testing
#146
Posted 13 July 2012 - 01:28 AM
Asgaroth, on 11 July 2012 - 09:26 AM, said:
maxNumberOfFiles This option limits the number of files that are allowed to be uploaded using this widget. By default, unlimited file uploads are allowed. Type: number Example: 10
Thanks!!!
Where will we include these option in xupload? in widget or in separate js code ?
i tried
<?php Yii::app()->clientScript->registerScript('script', <<<JS
$('#images-form').fileupload({
singleFileUploads: true
});
JS
, CClientScript::POS_READY);?>
in view and
<?php
$this->widget( 'xupload.XUpload', array(
'url' => Yii::app( )->createUrl( "/site/upload"),
//our XUploadForm
'model' => $photos,
//We set this for the widget to be able to target our own form
'htmlOptions' => array('id'=>'images-form'),
'attribute' => 'file',
//'multiple' => true,
'formView' => 'application.views.site._form',
'singleFileUploads' => true,
)
);
?>
Also tried 'singleFileUploads' in 'htmlOptions'
but all not worked for me..
#147
Posted 13 July 2012 - 09:25 AM
VinodC, on 13 July 2012 - 01:28 AM, said:
Where will we include these option in xupload? in widget or in separate js code ?
i tried
<?php Yii::app()->clientScript->registerScript('script', <<<JS
$('#images-form').fileupload({
singleFileUploads: true
});
JS
, CClientScript::POS_READY);?>
in view and
<?php
$this->widget( 'xupload.XUpload', array(
'url' => Yii::app( )->createUrl( "/site/upload"),
//our XUploadForm
'model' => $photos,
//We set this for the widget to be able to target our own form
'htmlOptions' => array('id'=>'images-form'),
'attribute' => 'file',
//'multiple' => true,
'formView' => 'application.views.site._form',
'singleFileUploads' => true,
)
);
?>
Also tried 'singleFileUploads' in 'htmlOptions'
but all not worked for me..
XUpload its a CJuiInputWidget, you use it and pass js options as you would with the options param
- Extension: XUpload - jQuery File Upload Extension
- Extension: PhpQuickProfiler - A Web Log Router that will help you profile your application
- Extension: XDateView - A Date grouped Grid View
- Extension: Foundation - An easy to use, powerful, and flexible framework for building prototypes and production code on any kind of device.
- Wiki: How to generate Yii like Documentation
- Wiki: How to re enable logging during unit testing
#148
Posted 17 July 2012 - 06:32 AM
#149
Posted 18 July 2012 - 04:38 AM
first let me thank you for the creation of this very useful extension!
After some trying around I managed to get everything working as expected apart from one feature: I can not validate the file type as done by others here in the thread or as described in the jQuery plugins docs.
My widget is called like this:
<?php
$this->widget('xupload.XUpload', array(
'url' => Yii::app()->createUrl('members/default/upload', array('id'=>$model->id)),
'model' => $upload,
'attribute' => 'file',
'multiple' => true,
'options' => array(
'maxFileSize'=>3000000,
'acceptFileTypes' => "/(\.|\/)(gif|jpe?g|png)$/i",
),
));
?>The jQuery generated for xUpload is as follows:
jQuery('#XUploadForm-form').fileupload({'maxFileSize':3000000,'acceptFileTypes':'/(\\.|\\/)(gif|jpe?g|png)$/i','url':'/members/default/upload/id/26'});However, attaching any file that should validate (or any other) results in the following error in my console:
Quote
Any ideas why that happens? I'm kind of stuck here
Best,
Philipp
#150
Posted 18 July 2012 - 09:10 AM
Philipp, on 18 July 2012 - 04:38 AM, said:
first let me thank you for the creation of this very useful extension!
After some trying around I managed to get everything working as expected apart from one feature: I can not validate the file type as done by others here in the thread or as described in the jQuery plugins docs.
My widget is called like this:
<?php
$this->widget('xupload.XUpload', array(
'url' => Yii::app()->createUrl('members/default/upload', array('id'=>$model->id)),
'model' => $upload,
'attribute' => 'file',
'multiple' => true,
'options' => array(
'maxFileSize'=>3000000,
'acceptFileTypes' => "/(\.|\/)(gif|jpe?g|png)$/i",
),
));
?>The jQuery generated for xUpload is as follows:
jQuery('#XUploadForm-form').fileupload({'maxFileSize':3000000,'acceptFileTypes':'/(\\.|\\/)(gif|jpe?g|png)$/i','url':'/members/default/upload/id/26'});However, attaching any file that should validate (or any other) results in the following error in my console:
Any ideas why that happens? I'm kind of stuck here
Best,
Philipp
Hi there, check this previous post, you should add js: to the string
- Extension: XUpload - jQuery File Upload Extension
- Extension: PhpQuickProfiler - A Web Log Router that will help you profile your application
- Extension: XDateView - A Date grouped Grid View
- Extension: Foundation - An easy to use, powerful, and flexible framework for building prototypes and production code on any kind of device.
- Wiki: How to generate Yii like Documentation
- Wiki: How to re enable logging during unit testing
#151
Posted 18 July 2012 - 11:23 AM
I have installed this ext and success to upload,
I'm followed this http://www.yiiframew...pload-workflow/ to input value from another field to database
but i still not success with that...
My Submit button doesn't work. anyone can help me?
#152
Posted 18 July 2012 - 01:47 PM
giantdut, on 18 July 2012 - 11:23 AM, said:
I have installed this ext and success to upload,
I'm followed this http://www.yiiframew...pload-workflow/ to input value from another field to database
but i still not success with that...
My Submit button doesn't work. anyone can help me?
Whats the problem? please elaborate so that we can help you
- Extension: XUpload - jQuery File Upload Extension
- Extension: PhpQuickProfiler - A Web Log Router that will help you profile your application
- Extension: XDateView - A Date grouped Grid View
- Extension: Foundation - An easy to use, powerful, and flexible framework for building prototypes and production code on any kind of device.
- Wiki: How to generate Yii like Documentation
- Wiki: How to re enable logging during unit testing
#153
Posted 18 July 2012 - 11:20 PM
And now i got problem, becouse my form will upload 2 type of data
1. img -> for cover url
2. mp3 -> for music
xupload override all files form so i must do a validation before i save.
#154
Posted 19 July 2012 - 05:33 AM
I am having a couple of issues with the extension. One is that none of the styling at all appears. I looked at the source of my page and all the template code is in the source, but it does not appear to do anything. This is my lesser issue.
The main issue is that when I run it, the extension only uploads the last file selected, then outputs to the browser the following:
[{"name":"423e83apt3b-ktchn2.jpg","type":"image\/jpeg","size":125567,"url":"\/1grout\/07192012\/423e83apt3b-ktchn2.jpg","thumbnail_url":"\/1grout\/07192012\/423e83apt3b-ktchn2.jpg","delete_url":"\/moneyshot\/default\/upload\/_method\/delete\/file\/%2Fhome%2Fairmuse%2Fpublic_html%2Fprotected%2F..%2F1grout%2F07192012%2F423e83apt3b-ktchn2.jpg","delete_type":"POST"}]My view file calls the widget as such:
<div id='uploadArea'>
<?php
$this->widget('xupload.XUpload', array(
'url' => Yii::app()->createUrl("moneyshot/default/upload"),
'model' => $model,
'attribute' => 'file',
'multiple' => true,
));
?>
</div><!-- uploadArea -->In my default controller, I put the following:
public function actions()
{
return array(
'upload'=>array(
'class'=>'xupload.actions.XUploadAction',
'path' =>Yii::app() -> getBasePath() . "/../" . user()->id . "grout",
'publicPath' => Yii::app() -> getBaseUrl() . "/" . user()->id . "grout",
),
);
}In XUpload.php I set multiple to true.
Thank you.
#155
Posted 19 July 2012 - 05:44 AM
#156
Posted 19 July 2012 - 01:55 PM
fpolli, on 19 July 2012 - 05:33 AM, said:
I am having a couple of issues with the extension...
Hi there, the styling is not an issue, please read through the previos posts to see why. as for the other issue, which browser are you using, and have you tried other browsers? does the the javascript console outputs something?
- Extension: XUpload - jQuery File Upload Extension
- Extension: PhpQuickProfiler - A Web Log Router that will help you profile your application
- Extension: XDateView - A Date grouped Grid View
- Extension: Foundation - An easy to use, powerful, and flexible framework for building prototypes and production code on any kind of device.
- Wiki: How to generate Yii like Documentation
- Wiki: How to re enable logging during unit testing
#157
Posted 19 July 2012 - 01:56 PM
VinodC, on 19 July 2012 - 05:44 AM, said:
I don't think so, I don't see a way to get those values on the client side. not sure about HTML5 though
- Extension: XUpload - jQuery File Upload Extension
- Extension: PhpQuickProfiler - A Web Log Router that will help you profile your application
- Extension: XDateView - A Date grouped Grid View
- Extension: Foundation - An easy to use, powerful, and flexible framework for building prototypes and production code on any kind of device.
- Wiki: How to generate Yii like Documentation
- Wiki: How to re enable logging during unit testing
#158
Posted 19 July 2012 - 04:21 PM
Asgaroth, on 19 July 2012 - 01:55 PM, said:
Hi Asgaroth, thanks for the response. I figured out what was going on. I had used renderpartial to draw the upload form and needed to put processoutput=true. I have basic functionality established, and now just need to iron out all the kinks. Good extension.
#159
Posted 20 July 2012 - 05:41 AM
okiem, on 27 April 2012 - 03:09 AM, said:
if ($this -> subfolderVar !== null) {
$this -> _subfolder = Yii::app() -> request -> getQuery($this -> subfolderVar, date("mdY"));
} else if ($this -> subfolderVar !== false) {
$this -> _subfolder = date("mdY");
}
That means when subfolderVar is set to false, the condition subfolderVar !== null equates to true and a subfolder still gets made
The fix should be:
if ($this -> subfolderVar !== null && $this -> subfolderVar !== false) {
$this -> _subfolder = Yii::app() -> request -> getQuery($this -> subfolderVar, date("mdY"));
} else if ($this -> subfolderVar !== false) {
$this -> _subfolder = date("mdY");
}
I noticed this same thing in the logic, but isn't the solution even easier?
if($this->subfolderVar)
....
elseif($this->subfolderVar!==false)
.....
Whether subfolderVar is set to false, null or the empty string, the first condition will be false. Then the second condition will only be false if subfolderVar is specifically set to false.
#160
Posted 26 July 2012 - 10:17 AM
can we set subfolderVar from the widget code?
i mean like this:
$this->widget('xupload.XUpload', array(
'url' => Yii::app()->createUrl("machines/upload"),
'model' => $model2,
'attribute' => 'file',
'multiple' => true,
'options'=>array(
'maxNumberOfFiles' => 1,
'maxFileSize'=>3000000,
'subfolderVar'=>'01012012',
)
for me, this doesn't work, it uploads to default dmY subfolder.
i really need to set the subfoldervar from the widget, is there a way to this?

Help













