I want to create a form and use ajax for the action.
Also I want to upload a file (image) with this photo.
I use CHtml::ajaxSubmitButton for another form with mo file upload.
How I can do it (to upload a file with ajax) with Yii?I look at extensions but I did not find something so long.
Ajax can’t control file uploading. You need to use a jQuery plugins or something hand made solution.
And if you are not so experienced, you need to learn more.
Please read next articles:
follow the links, and learn how it works. It work not with ajax, but user view a page, and it seems like form uses ajax.
Every plugin do similar things. There is a process of creating a hidden iframe and creating a new file element. Then submit this form to a srever. Then receives an answer and parse a content of hidden iframe.
So maybe to try something by hand with jquery
i’ve done it by hand with jquery too