Yii Framework Forum: [Extension] Xupload - Yii Framework Forum

Jump to content

  • (20 Pages)
  • +
  • « First
  • 4
  • 5
  • 6
  • 7
  • 8
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

[Extension] Xupload Rate Topic: ***** 1 Votes

#101 User is offline   siwen66 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 7
  • Joined: 27-April 12

Posted 29 April 2012 - 03:50 PM

View PostAsgaroth, on 29 April 2012 - 03:44 PM, said:

Well thats something you can do without the Widget, the widget is for uploading files, you can delete them after you have uploaded them using the widget. but not after page reload.

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?
0

#102 User is offline   siwen66 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 7
  • Joined: 27-April 12

Posted 30 April 2012 - 08:20 AM

I find out a solution for auto-populate. Insert display table into form.php between tbody tags.
0

#103 User is offline   Sampa 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 173
  • Joined: 18-December 11
  • Location:Stockholm,Sweden

Posted 04 May 2012 - 11:28 AM

for a onComplete callback,change 'onComplete' option to 'completed'
works like a charm with the updated version.

found it at:
https://github.com/b...ad/wiki/Options
0

#104 User is offline   jiaming 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 262
  • Joined: 10-April 12

Posted 04 May 2012 - 02:27 PM

View PostAsgaroth, on 28 April 2012 - 05:57 PM, said:

Don't save them then, upload them to a temporary folder, and keep the paths in memory (session for example). save them only after the other form has been submitted and move the files to the final folder, have a cron empty the files in the temporary folder ever 24 hours or so, depending on your necessity.

Or you can have your _form start the upload or send the other form's data

https://github.com/b...ional-Form-Data

Take a look at the various wikies

https://github.com/b...ile-Upload/wiki


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!!!!!
0

#105 User is offline   Dyego Nery 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 105
  • Joined: 26-August 11

Posted 05 May 2012 - 09:16 PM

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
http://www.emuitocarro.com.br - Classificado Online de VeĆ­culos


http://www.yiibrasil.com.br - Blog com dicas e tutoriais sobre o Yii Framework.
0

#106 User is offline   Sampa 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 173
  • Joined: 18-December 11
  • Location:Stockholm,Sweden

Posted 07 May 2012 - 04:54 AM

View Postjiaming, on 04 May 2012 - 02:27 PM, said:

Thanks so much for your amazing extension.
Do you have any demos..or samples about this?(upload with form)

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!!!!!


You can do what I did with avatars here: http://www.yiiframew...-persona-login/
0

#107 User is offline   manuelpm 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 11
  • Joined: 21-January 12
  • Location:Guatemala

Posted 15 May 2012 - 01:38 AM

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.
0

#108 User is offline   Asgaroth 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 371
  • Joined: 17-July 09
  • Location:Bogota, Colombia

Posted 15 May 2012 - 01:23 PM

View Postmanuelpm, on 15 May 2012 - 01:38 AM, said:

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?
- Extension: Dynamic DataProvider Behavior
- 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
0

#109 User is offline   manuelpm 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 11
  • Joined: 21-January 12
  • Location:Guatemala

Posted 15 May 2012 - 01:32 PM

View PostAsgaroth, on 15 May 2012 - 01:23 PM, said:

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);}});

0

#110 User is offline   Asgaroth 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 371
  • Joined: 17-July 09
  • Location:Bogota, Colombia

Posted 15 May 2012 - 01:37 PM

View Postmanuelpm, on 15 May 2012 - 01:32 PM, said:

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
- Extension: Dynamic DataProvider Behavior
- 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
0

#111 User is offline   jmariani 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 53
  • Joined: 12-January 12

Posted 15 May 2012 - 11:42 PM

Hi!

Great extension!

One question: How to limit the upload to just one file?

Thanks!
0

#112 User is offline   johnrey1219 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 16-May 12

Posted 16 May 2012 - 03:43 AM

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,...
0

#113 User is offline   manuelpm 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 11
  • Joined: 21-January 12
  • Location:Guatemala

Posted 16 May 2012 - 12:57 PM

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
0

#114 User is offline   Asgaroth 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 371
  • Joined: 17-July 09
  • Location:Bogota, Colombia

Posted 16 May 2012 - 01:36 PM

View Postmanuelpm, on 16 May 2012 - 12:57 PM, said:

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
- Extension: Dynamic DataProvider Behavior
- 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
0

#115 User is offline   johnrey1219 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 16-May 12

Posted 18 May 2012 - 12:47 AM

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...
0

#116 User is offline   Asgaroth 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 371
  • Joined: 17-July 09
  • Location:Bogota, Colombia

Posted 18 May 2012 - 01:28 AM

View Postjohnrey1219, on 18 May 2012 - 12:47 AM, said:

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...


1. Can you show us the JSON your server is returning from the call? (using firebug or similar)

2. See this
- Extension: Dynamic DataProvider Behavior
- 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
0

#117 User is offline   johnrey1219 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 16-May 12

Posted 21 May 2012 - 02:26 AM

1. 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?

2. am i going to paste it to my layouts/main.php?
0

#118 User is offline   Asgaroth 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 371
  • Joined: 17-July 09
  • Location:Bogota, Colombia

Posted 21 May 2012 - 09:29 AM

View Postjohnrey1219, on 21 May 2012 - 02:26 AM, said:

1. 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?

2. 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.
- Extension: Dynamic DataProvider Behavior
- 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
0

#119 User is offline   nightmove 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 48
  • Joined: 11-March 12
  • Location:Germany

Posted 01 June 2012 - 08:09 AM

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>

0

#120 User is offline   Asgaroth 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 371
  • Joined: 17-July 09
  • Location:Bogota, Colombia

Posted 01 June 2012 - 09:12 AM

View Postnightmove, on 01 June 2012 - 08:09 AM, said:

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?


Its the firebug console showing anything? looks like a javascript error.
- Extension: Dynamic DataProvider Behavior
- 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
0

Share this topic:


  • (20 Pages)
  • +
  • « First
  • 4
  • 5
  • 6
  • 7
  • 8
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users