Yii CUploadedFile::getInstance returns NULL

Practice




Yii CUploadedFile::getInstance returns NULL


check that when you created the form you passed the option
beginWidget('CActiveForm',array(
'htmlOptions'=>array('enctype'=>'multipart/form-data'),
)); ?>

This determines how the form data is encoded when it is sent to the server. Usually there is no need to set the enctype attribute, the data is understood correctly on the server side anyway. However, if you are using a field for uploading a file (input type="file"), you should set the enctype attribute to multipart/form-data.

Comments

To leave a comment

If you have any suggestion, idea, thanks or comment, feel free to write. We really value feedback and are glad to hear your opinion.
To reply

Lectures and tutorial on "Famworks"

Terms: Famworks