I am using Pluploader extension in Yii but I cannot get it to work on my code. I copied the same code as explained in the site but it shows me the following error:
Property "PluploadWidget.config" is not defined.
my code is:
<?php $this->widget('application.extensions.plupload.PluploadWidget', array(
'config' => array(
//'runtimes' => 'gears,flash,silverlight,browserplus,html5',
'url' => $this->createUrl('news/upload'),
//'max_file_size' => str_replace("M", "mb", ini_get('upload_max_filesize')),
'max_file_size' => Yii::app()->params['maxFileSize'],
'chunk_size' => '1mb',
'unique_names' => true,
'filters' => array(
array('title' => Yii::t('app', 'Images files'), 'extensions' => 'jpg,jpeg,gif,png'),
),
'language' => Yii::app()->language,
'max_file_number' => 1,
'autostart' => true,
'jquery_ui' => false,
'reset_after_upload' => true,
),
'callbacks' => array(
'FileUploaded' => 'function(up,file,response){console.log(response.response);}',
),
'id' => 'uploader'
)); ?>
is there anything wrong with my code?
I managed to solve the first issue by using this improved version. Now I have got another issue. When I start uploading the file it uploads my selected file into the system temp folder with a temporary name. The thing is that I want to get the files in my project folder not to leave them in temp directory. Also I need uploaded files name to store it in my database after submitting the form.
It shows an exclamation Icon beside the file name after finishing uploading while the file(s) are uploaded to the temp folder properly.
The question is that how can I force the uploader to transfer the files into a particular directory in my project. and how can I post the files name after submitting a form to store them into the database.
On the extension's download page, you can see that someone did their own file-moving function.
You can also use your own function to move the file, once it is uploaded to pupload's temp folder. Try and trace the server-side function (also found on that same link)