Patrick
Patrick

Reputation: 1275

php (and codeigniter) upload size limited to 1MB

I have a function (I'm using CodeIgniter) that uploads a file, resizes it, and saves details into a database.

I have no problems in uploading images up to 1MB, so I know that permissions work ok. However, as soon as I try to upload something above 1MB, the function becomes really slow, and after a while I'm presented with a blank page.

These are the main values in the php ini file:

post_max_size: 32M
max_input_time: 60
max_execution_time: 30
file_uploads: 1
upload_max_filesize: 32M

According to this I should have plenty of time and megabytes to upload the file successfully.

What else this could depend on?

UPDATE (following Mike's and Minboost questions below)

a. logs are clean, no sign of problems there and actually the log shows that the page has been processed on 0.03 seconds!

b. Memory_limit is 96 MB

c. I'm not applying XSS filters on this ...any additional ideas?

the thing i don't understand is that it takes a very long time to upload a file even on my Mac (localhost); i've managed to upload a 2.7mb picture, however i had to wait there for a few minutes. there seem to be a step change (for the worse) above the 500KB threshold. Upload is smooth and fast below that, and becomes very slow above it..

Upvotes: 1

Views: 1547

Answers (2)

NDBoost
NDBoost

Reputation: 10644

Are you checking error_logs? What are the errors returned? Make sure you're not XSS filtering the upload file form field. Also I've had to try this before: set the max_allowed_packets higher in /etc/my.cnf and restart MySQL.

Upvotes: 1

minboost
minboost

Reputation: 2563

It could also depend on memory_limit.

Upvotes: 1

Related Questions