Hi,I have problem in uploading files larger than 1MB!!
I changed the php.ini setting to this:
memory_limit = 32M ---> 320M
post_max_size = 16M-->160M
upload_max_file size = 32M--> 320M
with the initial setting i could upload files smaller than 1M and for larger till 6M it echoed query error(means it was unable to insert the file into database) and for larger than 6M it echoed fatal error:
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 24117249 bytes) in C:\xampp\htdocs \func\publicati on.php on line 50
now with the changed numbers for all sizes i have query error
here is the query if needed
I roled back my php.ini settings to the initial and instead i made a .htaccess file in the root directory(so that in future i can use it in server) and added these:
AddHandler application/x-httpd-php .php
php_value post_max_size 200M
php_value upload_max_file size 200M
php_value memory_limit 300M
php_value output_bufferin g on
php_value max_execution_t ime 259200
php_value max_input_time 259200
php_value session.cookie_ lifetime 0
php_value session.gc_maxl ifetime 259200
php_value default_socket_ timeout 259200
in this way when i upload files in a directory, i can upload up to 20MB but if i want upload my files in db with blob var,i can only upload to the 1MB range,what should i do if i want to upload a larg file in my database?
I changed the php.ini setting to this:
memory_limit = 32M ---> 320M
post_max_size = 16M-->160M
upload_max_file size = 32M--> 320M
with the initial setting i could upload files smaller than 1M and for larger till 6M it echoed query error(means it was unable to insert the file into database) and for larger than 6M it echoed fatal error:
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 24117249 bytes) in C:\xampp\htdocs \func\publicati on.php on line 50
now with the changed numbers for all sizes i have query error
here is the query if needed
Code:
$upload = "INSERT INTO upload(name, size,type,content) ".
"VALUES ('$fileName', '$fileSize', '$fileType','$content')";
mysql_query($upload) or die('Unable to upload, query failed');
AddHandler application/x-httpd-php .php
php_value post_max_size 200M
php_value upload_max_file size 200M
php_value memory_limit 300M
php_value output_bufferin g on
php_value max_execution_t ime 259200
php_value max_input_time 259200
php_value session.cookie_ lifetime 0
php_value session.gc_maxl ifetime 259200
php_value default_socket_ timeout 259200
in this way when i upload files in a directory, i can upload up to 20MB but if i want upload my files in db with blob var,i can only upload to the 1MB range,what should i do if i want to upload a larg file in my database?
Comment