0

Possible Duplicate:
Why would $_FILES be empty when uploading files to PHP?

I am trying to upload files that are big up to 15 Megabytes.
My PHP configuration in .htaccess file:

php_value upload_max_filesize 20M
php_value post_max_size 20M
php_value max_execution_time 300
php_value max_input_time 300

and in PHP with ini_get() and phpinfo() I saw the right value 20M. But when I try to upload 10 MB file it returns empty $_POST and $_FILES arrays. I checked the $_SERVER["CONTENT_LENGTH"] variable and it returns me 10671561 (10.4MB), which is smaller than the 20M config value.

What can I do to fix this?

Community
  • 1
  • 1
CaTz
  • 305
  • 3
  • 5
  • 20

2 Answers2

1

Your htaccess code is correct. You can try below code in your php file then try it.

ini_set( 'memory_limit', '20M' );
ini_set('upload_max_filesize', '20M');  
ini_set('post_max_size', '20M');  
ini_set('max_input_time', 300);  
ini_set('max_execution_time', 300); 

Let me know if not working.

Abid Hussain
  • 7,724
  • 3
  • 35
  • 53
0

Is your server configured to use .htaccess files? If you're using Apache, you should check your virtual host config (e.g., /etc/apache2/sites-available/<your site>) and make sure that AllowOverride All is set.

adamdunson
  • 2,635
  • 1
  • 23
  • 27