Xupload OWN controller example? combined with form? Eajax examples? Any upload extension suggestions?

Hello everyone,

I am thinking about file upload system these days. I need to upload multiple files and save in database(save path+name).

I was using Cfileupload, but it does not support progress bar which is little bit sad.

So i am thinking about using some ajax upload these days. But i will ONLY upload them to the temporary folder UNTIL the total _form is submitted(the user clicks submit).

I tried Xupload and EajaxUpload.

About Xupload, it’s cool but I really have no idea about how to integrate it with my _form.php. How can I use my own controller/model instead of xuploadAction and XuploadForm??? Because I need to submit other data… Just like what you can do in this forum post system…

About Eajaxupload, i found it is not supported for database…(can only save filename but not path) is that true????

Anyone has ever used these 2 ext or any better ext in your OWN controller/model??? Submit files with other data????? First ajax upload it to a temporary server then save it with the other data when submit button is clicked…?

Any examples would be very very helpful!

Thank you guys very much…

I really appreciate it!!!!!!!!

Best regards.

try flash upload swfupload or uploadify(it seems not to be free since 3.x), and plupload is also awesome . when using these flash or ajax upload tool the validation is a problem . flash upload can bring the post data and can validate the file in client end . so one solution is to validate the other fields firstly using cactiveform 's ajaxValidation and client validation if all passed then use flash submit them together.(you should read the doc of CActiveForm::clientOptions there are some js hooks when the validation is complete that you can do flash uploading in the hook function)

the ajaxupload in yii extension repo do have limitation that you can’t get the uploaded file path . but you can do some minor modification , to be frank this extension is not too comfortable to use ,it comes a strange way not too yiilish :D

Thanks so much for your reply. I just took a look at these ext, i found swfupload and pupload are really nice.

However, I have no idea about how to handle this kind of ext in my controller(for example, get file name /file path and save to database) I only know how to do that with CFILEupload…like this…


 $path='/uploads/'.$this->_->id.'/'.$model->owner_id.'/'.$filename;




			       $model->file->saveAs("uploads/".$model->courses_id."/".$model->owner_id."/".$filename); 




                               $model ->path = $path;

                               $model ->filename =$filename;


                               $model ->save();

I really have no idea where to put these codes in upload extensions…

Do you have any examples?

thanks!!

you have example of xupload in the bootstrapped app, in protected/user/_form is the widget.

Thanks for your help…

Due to certain reasons…I need to process the uploaded file and convert them to pdf.

Also I do not want to use ajax in my page.

So I just use Yii’s multiFileUpload and it works fine now.

The problem is

  1. it’s not supported multiple choices(only 1 each time due to javascript reason)

I want to try html5, but don’t know how.

2.it’s kind of “ugly…” need to be styled… there is an attribute called skin… but still don’t know how to use it…