The Default Size File In Cuploadfile ?

Dearl friends,

I have use Yii CuploadFile component in my website,


$uploadedFile = CUploadedFile::getInstance($model, 'cate_image');

however,I can not load my image which 6.5 mb,in this case I have 2 question which I need it now.

  1. what is the largest default size in CuploadFile ?

  2. how can I customize the file size in CuploadFile ?

thankyou very much

Hi,

Check your upload_max_filesize limit in php.ini file.

  1. Maximum size of uploaded files isn’t limited by CUploadedFile, it’s limitation of your web server.

PHP Manual: Handling file uploads. Common Pitfalls

About PHP variable upload-max-filesize

  1. You can limit maximum allowed size of uploaded files in Yii by using CFileValidator in you model validation rules.

thankyou your answer, this helps me understand this problem.