kitune
(Shinkitune)
September 5, 2011, 2:57pm
1
Hi!
I want write an ajax uploader in yii but I don’t know wich is the best way.
I need this steps:
validate form (for title and description of the file)
Upload the file via AJAX (showing a percentaje of uploaded file)
Update the database with the new record.
Wich is the best and simple form to do this? I see some extensions but I don’t like it at all.
Note: I need this for upload big files, 150MB/200MB.
Sorry for my english… And thanks!
You should look at the extentions repository
it might have just what you need
kitune
(Shinkitune)
September 6, 2011, 7:13am
3
Kiriakos Kappa Krastillis:
You should look at the extentions repository
it might have just what you need
Thanks Kiriakos, I have been looking the extensions repository but I don’t find the desidered funcionality…Ajax, form validation, update the database…
I sent you to the extensions repo because it has the eajaxupload in it. You still will need to do most of the logic on your own, ie:
If you want to validate the form before upload you will need to add a special handler to the form elemnts or use the ajax valitadion gii crud_generator creates.
If you want to keep the data of the files in db create a table and php model for that object and use it inside the controller of the upload.
kitune
(Shinkitune)
September 6, 2011, 2:50pm
5
Kiriakos Kappa Krastillis:
I sent you to the extensions repo because it has the eajaxupload in it. You still will need to do most of the logic on your own, ie:
If you want to validate the form before upload you will need to add a special handler to the form elemnts or use the ajax valitadion gii crud_generator creates.
If you want to keep the data of the files in db create a table and php model for that object and use it inside the controller of the upload.
Hi Kiriakos, I saw this extension but I saw some bad comments like:
This extension does not use CUploadedFile (or a variant of) for the file handling. This is a major problem as you can’t use a model’s validation rules, which is a possible security problem ; it will force you to have to two sets of validation rules.
Also, it’s impossible to specify a file name to save as … seriously ?!?