Yii Framework Forum: Cfileuploaded Returns Null If File Upload Is Big - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Cfileuploaded Returns Null If File Upload Is Big Rate Topic: ***** 1 Votes

#1 User is offline   Elecen 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 10
  • Joined: 03-July 11

Posted 25 January 2014 - 10:33 AM

I am building a multi file upload with gallery script and I noticed that when I upload a file around 30MB CFileUploaded returns null when I try to get the file. The code however works perfectly fine with smaller images. Anyone has any info or workaround for this?

extra: checking even further, if the filesize is actually above 2MB CFileUploaded will return null when I try to get the file.

FYI: nginx configuration is fine and the file upload is accepted.
0

#2 User is offline   ORey 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 1,701
  • Joined: 20-April 09
  • Location:Moscow, Russia

Posted 25 January 2014 - 10:37 AM

First of all, you have two config params (php.ini):
; Maximum allowed size for uploaded files.
upload_max_filesize = ...

; Must be greater than or equal to upload_max_filesize
post_max_size = ...


Second, you can use file size validation
God is real unless declared as integer
0

#3 User is offline   Elecen 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 10
  • Joined: 03-July 11

Posted 25 January 2014 - 10:50 AM

View PostORey, on 25 January 2014 - 10:37 AM, said:

First of all, you have two config params (php.ini):
; Maximum allowed size for uploaded files.
upload_max_filesize = ...

; Must be greater than or equal to upload_max_filesize
post_max_size = ...


Second, you can use file size validation


You were absolutely right!! Totally forgot to change the php configuration! Works like a charm! :D
0

#4 User is offline   ORey 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 1,701
  • Joined: 20-April 09
  • Location:Moscow, Russia

Posted 25 January 2014 - 11:01 AM

View PostElecen, on 25 January 2014 - 10:50 AM, said:

You were absolutely right!! Totally forgot to change the php configuration! Works like a charm! :D


NB: modifying ini settings is not a solution. It's just a value for setting validator file size. The solution is using validation of input.
God is real unless declared as integer
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users