Yii Framework Forum: eajaxupload Failed Upload - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

eajaxupload Failed Upload Rate Topic: ***** 1 Votes

#1 User is offline   abedi98 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 86
  • Joined: 29-August 11

Posted 03 October 2011 - 07:14 AM

hi
i want to use this extention >> http://www.yiiframew...ion/eajaxupload

and use to my module but when selected file , failed 1.jpg 69.5kB Failed

create.php in Post View

<div class="form">
<?php $form=$this->beginWidget('CActiveForm'); ?>
 
    <?php //echo $form->errorSummary($model); ?>
 
    <div class="row">
        <?php echo $form->label($model,'title'); ?>
        <?php echo $form->textField($model,'title') ?>
    </div>
	
	<?php $this->widget('ext.EAjaxUpload.EAjaxUpload',
array(
        'id'=>'uploadFile',
        'config'=>array(
               'action'=>'/post/upload',
               'allowedExtensions'=>array("jpg"),//array("jpg","jpeg","gif","exe","mov" and etc...
               'sizeLimit'=>10*1024*1024,// maximum file size in bytes
               // minimum file size in bytes
               //'onComplete'=>"js:function(id, fileName, responseJSON){ alert(fileName); }",
               //'messages'=>array(
               //                  'typeError'=>"{file} has invalid extension. Only {extensions} are allowed.",
               //                  'sizeError'=>"{file} is too large, maximum file size is {sizeLimit}.",
               //                  'minSizeError'=>"{file} is too small, minimum file size is {minSizeLimit}.",
               //                  'emptyError'=>"{file} is empty, please select files again without it.",
               //                  'onLeave'=>"The files are being uploaded, if you leave now the upload will be cancelled."
               //                 ),
               //'showMessage'=>"js:function(message){ alert(message); }"
              )
)); ?>
    
 
<?php $this->endWidget(); ?>
</div>


actionUpload in post Model Class

public function actionUpload()
{
	Yii::import("ext.EAjaxUpload.qqFileUploader");
 
        $folder='upload/';// folder for uploaded files
        $allowedExtensions = array("jpg");//array("jpg","jpeg","gif","exe","mov" and etc...
        $sizeLimit = 10 * 1024 * 1024;// maximum file size in bytes
        $uploader = new qqFileUploader($allowedExtensions, $sizeLimit);
        $result = $uploader->handleUpload($folder);
        $result=htmlspecialchars(json_encode($result), ENT_NOQUOTES);
        echo $result;// it's array
}

Attached File(s)


0

#2 User is offline   abedi98 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 86
  • Joined: 29-August 11

Posted 04 October 2011 - 03:53 AM

ehe uheee, nobody !?
0

#3 User is offline   abedi98 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 86
  • Joined: 29-August 11

Posted 12 October 2011 - 01:10 PM

ALOOOOOOOOO PLEASEEEEEEEEEEEEEEEE
0

#4 User is offline   fgpsmith 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 7
  • Joined: 20-October 11

Posted 28 October 2011 - 01:41 AM

I got the same error when I tried that extension.
0

#5 User is offline   fgpsmith 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 7
  • Joined: 20-October 11

Posted 28 October 2011 - 12:34 PM

I've found a way round it... you need to increase the file upload limits.

Either put the following in your php.ini file:
post_max_size = 10M
upload_max_filesize = 10M



or the following in your .htaccess file:
php_value upload_max_filesize 10M
php_value post_max_size 10M

0

#6 User is offline   papagel75 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 04-October 11

Posted 21 November 2011 - 10:06 AM

I experience a similar problem.
It is not due to php settings since I can see the file uploaded successfully.

Still, the script returns a Failed status.

I will conduct a more tests on the actual extension to find the core of the problem.
0

#7 User is offline   maupv99 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 01-March 12

Posted 19 April 2012 - 01:22 PM

I found out that it has a conflict with Yii´s CSRF Validation. Solved that problem allowing CSRF token to be submitted by GET (http://www.yiiframew...ramework-files/)
0

#8 User is offline   MACRO-GOD! 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 17-May 12
  • Location:Oregon

Posted 17 May 2012 - 02:07 AM

if your running on a linnux server create a file called .user.ini (talk to your server admin first!) and set the max post size and max upload file size properties as though you were editing php.ini

This helped me a lot but for some strange reason the callback is still broken, the file uploads but the little tool tip display says "failed".
0

#9 User is offline   rajesh chaurasia 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 42
  • Joined: 12-January 13
  • Location:Mohali

Posted 13 March 2013 - 11:30 PM

when i upload an image it give an error message increase post max size and upload max size 10m i not understand how to fixed it problem.
0

#10 User is offline   Jonauz 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 16-March 13

Posted 16 March 2013 - 09:44 PM

Hi,
I'm new in Yii, straggling with EAjaxUpload extension. I keep getting "image.png 1.2kB Failed" on upload.
In console it shows:
POST http ://localhost/testdrive/index.php?r=controller/upload&PHPSESSID=&YII_CSRF_TOKEN=64cdd116e7f456ce0257dc5b86d55da437e74cd5&qqfile=image.png 404 (Not Found) fileuploader.js:1204
qq.extend._upload fileuploader.js:1204
qq.UploadHandlerAbstract.upload fileuploader.js:892
qq.FileUploaderBasic._uploadFile fileuploader.js:397
qq.FileUploaderBasic._uploadFileList fileuploader.js:388
qq.FileUploaderBasic._onInputChange fileuploader.js:372
qq.UploadButton.onChange fileuploader.js:309
(anonymous function) fileuploader.js:825

Checked all max files sizes allowed many times, seems fine, php.ini has 32MB allowed.

My "uploads" directory is in "WebRoot/testdrive/uploads/" with
$folder=Yii::app()->request->baseUrl.'/uploads/';

I'm using simplest steps as a base from here:
http ://www.yiiframework.com/doc/guide/1.1/en/quickstart.first-app
And adding functionality to send an image to server with this tool and simplest way it is written there:
http ://www.yiiframework.com/extension/eajaxupload/

Can't make it work, I would appreciate any help.
Thanks
0

#11 User is offline   Bibi40k 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 33
  • Joined: 16-December 10

Posted 11 April 2013 - 03:16 AM

hi,
it doesn't matter if you set post_max_size and upload_max_size into php.ini unless values ARE IDENTICAL with the ones from this extensions.
0

#12 User is offline   ArturoGP 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 31-October 13

Posted 14 November 2013 - 12:19 PM

hi!!

how you resolved your problem, i have the same

POST http ://localhost/testdrive/index.php?r=controller/upload&PHPSESSID=&YII_CSRF_TOKEN=....=image.png 404 (Not Found) fileuploader.js:1205

please send your answer to: arturo@jovenclub.cu
0

#13 User is offline   ArturoGP 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 31-October 13

Posted 14 November 2013 - 01:09 PM

hi!!

how you resolved your problem, i have the same

POST http ://localhost/testdrive/index.php?r=controller/upload&PHPSESSID=&YII_CSRF_TOKEN=....=image.png 404 (Not Found) fileuploader.js:1205

please send your answer to: arturo@jovenclub.cu
0

#14 User is offline   Neovash 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 13
  • Joined: 09-November 13
  • Location:Philippines

Posted 03 February 2014 - 11:13 PM

hi,

i tried uploading 1200 files in one batch, and it doesnt seem to work(nothing happens), but no errors are given.

so far, i have tried 133 files in one Go, with no problem.

any idea what causes this?
0

#15 User is offline   Neovash 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 13
  • Joined: 09-November 13
  • Location:Philippines

Posted 04 February 2014 - 01:53 AM

Anyway, sorry for not being able to provide a solution for the problem in this topic, i had the same problem before, and i got the extension to work, but i forgot what i exactly did to fix it.

will try to figure it out and give you feedback, as soon as i can.
0

Share this topic:


Page 1 of 1
  • 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