in jQuery file upload PHP demo code, in index.PHP a get method is called to display files by default(auto populate). Can we do same thing here to display default?
in jQuery file upload PHP demo code, in index.PHP a get method is called to display files by default(auto populate). Can we do same thing here to display default?
I find out a solution for auto-populate. Insert display table into form.php between tbody tags.
for a onComplete callback,change ‘onComplete’ option to ‘completed’
works like a charm with the updated version.
found it at:
Thanks so much for your amazing extension.
Do you have any demos…or samples about this?(upload with form)
I see the wiki but not quite understand…
It seems like the wiki is trying to tell me how to submit the xupload form with extra data…but it will not start to upload until i submit other form…
I don’t want this. because it will cause the user to wait a long time until the upload process is done…
I want to use ajax upload to a temporary folder, but not save it to the server+database;
And when you submit yii’s _form , it will then, save to the server and database.
Sorry about the trouble I caused…
Thanks soooo much if you can help me out…
Thanks!!!!!
Just a doubt.
The extension don’t have the preview funcionallity?
The upload is working fine. But the previews don’t show up when each image is completed.
Hugs
You can do what I did with avatars here: http://www.yiiframework.com/forum/index.php/topic/31548-bootstrapped-yii-blog-demo-with-facebook-and-persona-login/
I dont know what I am doing wrong but onComplete is not working. Here is my code:
$this->widget('xupload.XUpload', array(
'url' => Yii::app()->createUrl("site/uploadP"),
'model' => $uploadm,
'attribute' => 'file',
'multiple' => false,
'options'=>array(
'onComplete'=>'js:function(){location.reload(true);}',
)
));
I just want to reload the page where xupload is working, any ideas? I have tried changing to complete and doesnt work either. Try all the suggestions in here and still is not working.
Can you check your page and see the javascript it is generating?
The code is generating is this:
jQuery('#XUploadForm-form').fileupload({'onComplete':function(){location.reload(true);}});
According to the documentation the callback name is ‘completed’ for the UI Plugin, and ‘done’ or ‘fileuploaddone’ for the basic plugin
Hi!
Great extension!
One question: How to limit the upload to just one file?
Thanks!
hello guys, i know that this is a really great extension, and i’m sure that this works like a magic as what most of you says,… but i only have one request, can some of you guys make any video tutorial on how to implement this extension to my web…and maybe post it on youtube then tag me the url, pls, bcuz i really can’t implement it by just following the set instructions, i learn much better and faster though visual demonstration… so if anybobdy who has a kind heart and able to do my request, it would be very much appreciated and i am giving you my advance thank you, thank you very much!, God bless you all,…
Asgaroth:
Thank you so much for your help, it is working now, now I have a problem with fileTypes, I have this code:
$uploadm = new XUploadForm;
$this->widget('xupload.XUpload', array(
'url' => Yii::app()->createUrl("site/uploadP"),
'model' => $uploadm,
'attribute' => 'file',
'multiple' => false,
'options'=>array(
'completed'=>'js:function(){location.reload(true);}',
//'sent'=>'js:function(){location.reload(true);}',
'maxNumberOfFiles'=>1,
'maxFileSize'=>3000000,
'acceptFileTypes'=>'/(\.|\/)(jpg|png)$/i'
)
));
it throws ‘this.options.acceptFileTypes.test is not a function’, now i read in git that is because i cant use the ‘’ but if i dont use them php throws unexpected /, any ideas anyone?
Thanks so much
try
'acceptFileTypes'=>"'/(\.|\/)(jpg|png)$/i'"
Untested, just random thoughs
hi
so i’ve tried implementing this extension w/o the aid of the video tutorial i requested for, and luckily i’m successful, it was integrated to my web but there’s one problem, when i try so start upload this error comes up:
Error SyntaxError: JSON.parse
can anyone help me?
tnx, more power to all of you,
ps, why does the UI of this extension doesn’t show as what the demo looks like, anyone know? and if you do, can you teach me how? again tnx very much…
Can you show us the JSON your server is returning from the call? (using firebug or similar)
See this
I don’t know what kind of JSON it is, in fact honestly i don’t know anything about JSONs, i’m new to this thing, . … i tried using the firebug but still i can see any server return from the call that you’re asking for… maybe i missed out something i guess…can you help me?
am i going to paste it to my layouts/main.php?
I’m sorry, I don’t tend to be rude, buts its kind of difficult to help you if you don’t know what you are doing. it could be anything, the ajax call pointing to a unexisten URL, an issue with your model/db, I couldn’t tell without taking a deep look through your project.
First, thanks for the great extension but it does not upload any file
The situation:
I installed the extension, put the code like it is mentioned on the extension page. When I click the "Add files" button and select a file, the dialog-box close and nothing happens. On the demo page, a box with the image and file size opens under the button. On my page, nothing happens.
Any idea?
view.php
<?php /** @var OfferController $this */ ?>
<div class="row-fluid">
<div class="span12">
<div class="page-header">
<h2>Create an offer</h2>
</div>
<?php
$this->widget('bootstrap.widgets.BootAlert');
/** @var BootActiveForm $form */
$form = $this->beginWidget('bootstrap.widgets.BootActiveForm', array(
'id'=>'create-offer-form',
'enableAjaxValidation'=>true,
'enableClientValidation'=>true,
));
echo $form->errorSummary($offerModel);
?>
<h3>General</h3>
<hr />
<?php
echo $form->textFieldRow($offerModel, 'title', array('class'=>'span3'));
echo $form->textAreaRow($offerModel, 'text');
echo $form->textFieldRow($offerModel, 'price', array('class'=>'span3'));
echo $form->labelEx($offerModel,'Valid from',array(
'class'=>'control-label',
));
$this->widget('zii.widgets.jui.CJuiDatePicker', array(
'model'=>$offerModel,
'attribute' => 'valid_from',
'language' => 'fr',
'defaultOptions' => array(
'showOn' => 'focus',
'changeMonth' => true,
'changeYear' => false,
'showButtonPanel' => true,
),
'options'=>array(
'showAnim'=>'fold',
'dateFormat' => 'yy-mm-dd',
),
'htmlOptions'=>array(
'id' => 'Offer_Valid_from',
'style'=>'height:20px;'
),
));
echo $form->labelEx($offerModel,'Valid till',array(
'class'=>'control-label',
));
$this->widget('zii.widgets.jui.CJuiDatePicker', array(
'model'=>$offerModel,
'attribute' => 'valid_till',
'language' => 'fr',
'defaultOptions' => array(
'showOn' => 'focus',
'changeMonth' => true,
'changeYear' => false,
'showButtonPanel' => true,
),
'options'=>array(
'showAnim'=>'fold',
'dateFormat' => 'yy-mm-dd',
),
'htmlOptions'=>array(
'id' => 'Offer_Valid_till',
'style'=>'height:20px;'
),
));
?>
<h3>Category</h3>
<div class="row-fluid">
<div class="span12">
<?php
$this->widget('zii.widgets.CListView', array(
'dataProvider'=>$categoryDataProvider,
'itemView'=>'//partials/category/_renderSingleGridviewRow',
));
?>
</div>
</div>
<h3>Pictures</h3>
<div class="row-fluid">
<div class="span12">
<?php
$this->widget('xupload.XUpload', array(
'url' => Yii::app()->createUrl("/offer/upload"),
'model' => $offerModel,
'attribute' => 'image',
'multiple' => false,
));
?>
</div>
</div>
<h3>User</h3>
<div class="row-fluid">
<div class="span12">
<?php $this->getGridViewUserFrontend(); ?>
</div>
</div>
<div class="row-fluid">
<div class="span12">
<?php
$this->widget('bootstrap.widgets.BootButton',
array(
'buttonType'=>'submit',
'icon'=>'ok',
'type'=>'primary',
'label'=>'Save',
));
$this->endWidget();
?>
</div>
</div>
<div class="footer">
<hr />
<?php $this->widget('bootstrap.widgets.BootButton', array(
'label'=>'Back',
'type'=>'',
'size'=>'',
'url'=>$this->createUrl('/user/listbe'),
)); ?>
</div>
</div>
</div>
Its the firebug console showing anything? looks like a javascript error.