I got stuck at one problem. I have this standard "Update Model" view on which there is form _view.php which is used to create and save model data.
Now on this form when I create new model data, amongst many textFields I have one fileField which uploads file to database - yes I chose this approach instead of FS.
When using "Create Model" form, file is uploaded to database and the there is displayed view.php which uses zii.widgets.CDetailView and there is displayed link that I can click on and open this file from DB.
So far so good.
Anyway when I use “Edit Model” view to edit the data, for example if I just change any textField value but I don’t touch fileField I get message “fileField cannot be empty”.
What approach do I have to choose to get this working?
and indeed now I can save updated model data without touching myFileField, but after data is saved file is erased from database since I haven’t chosen any in update form.
What I want to achieve is not to erase the file when I don’t choose any new file on update form and save it…