473,387 Members | 1,891 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

unable to upload files larger than 1MB

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_filesize = 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\publication.php on line 50
now with the changed numbers for all sizes i have query error
here is the query if needed
Expand|Select|Wrap|Line Numbers
  1. $upload = "INSERT INTO upload(name, size,type,content) ".
  2. "VALUES ('$fileName', '$fileSize', '$fileType','$content')";
  3. mysql_query($upload) or die('Unable to upload, query failed');
  4.  
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_filesize 200M
php_value memory_limit 300M
php_value output_buffering on
php_value max_execution_time 259200
php_value max_input_time 259200
php_value session.cookie_lifetime 0
php_value session.gc_maxlifetime 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?
Apr 24 '10 #1
2 3609
Markus
6,050 Expert 4TB
You should be utilizing the mysql_error() function to obtain information on the error.

Expand|Select|Wrap|Line Numbers
  1. mysql_query($upload) or die(mysql_error());
Apr 24 '10 #2
hi,i chcked,the error is :MySQL server has gone away
i searched about it,some has sayed that changing the global max_allowed_packet might solve the problem,but i didnt find this parameter in php.ini or elsewhere,what should i do then plz?
and i have my second question that consdering these problems and also database becoming so heavy,which method is better for uploading in a page that about 100 pdf articles are uploaded in a year(each can be up to 20M) and i should keep all so that visitors can download it ?up to now i chose to upload in blob var of db but i am affraid of my db being so heavy and also this problem that i cant upload large files,
Apr 25 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Tihon | last post by:
Hello! I again need your help, just can't understand whats going on. Got this upload pictures form and it's having problem handling large files (~1.5 - 2 MB). Everything works fine if i just...
4
by: Joe | last post by:
Hello, I have IIS 6.0 running on w2k3 Enterprise. I have three upload forms 1 to have restricted uploads .asp 2 to upload plain .asp any extension 3 a FP form upload non .asp
6
by: Shawn | last post by:
Hi. I'm letting the users upload images into a sybase 12.5 database. The problem is that when ContentLength exceeds 131 071 an exception occur. The e.Message property is empty so it doesn't tell me...
16
by: lawrence k | last post by:
I've a file upload script on my site. I just now used it to upload a small text document (10k). Everything worked fine. Then I tried to upload a 5.3 meg Quicktime video. Didn't work. I've...
0
by: Buddy Home | last post by:
Hello, I'm trying to upload a file programatically and occasionally I get the following error message. Unable to write data to the transport connection: An established connection was aborted...
3
by: Buddy Home | last post by:
Hello, I'm trying to upload a file programatically and occasionally I get the following error message. Unable to write data to the transport connection: An established connection was aborted...
6
by: fiefie.niles | last post by:
In ASP.Net (VS 2005), is there a way to limit the user to upload a file up to certain size (say, I would like to limit the user to upload at the maximum 1 meg of file) ? Thank you
7
by: MDB | last post by:
Anyone have any pointers / links / examples on how to upload files through FTP? I am currently using the built in file upload control however it seems to take a very long time to upload files and...
0
by: ll | last post by:
I'm working with 'pure ASP upload' script which is designed to redirect to an alert/error message, should a file larger than the set limit be attempted to be uploaded. The problem is that, while...
5
by: kailashchandra | last post by:
I am trying to upload a file in php,but it gives me error msg please Help me? My Code is like below:- i have one php file named upload.php and i have another html file named upload.html and...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.